Skip to content

Instantly share code, notes, and snippets.

@AjayPoshak
Last active July 14, 2018 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AjayPoshak/35ac769c56326a393458f8ea0fa084a1 to your computer and use it in GitHub Desktop.
Save AjayPoshak/35ac769c56326a393458f8ea0fa084a1 to your computer and use it in GitHub Desktop.
Initial webpack config
const path = require('path'),
AssetsPlugin = require('assets-webpack-plugin'),
HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'inline-source-map',
entry: './client/index.js',
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'build/client'),
publicPath: 'build/client/'
},
module: {
rules: [{ test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ }]
},
plugins: [
new HtmlWebpackPlugin({
template: './client/index.html',
title: 'Bus Booking in Africa'
}),
new AssetsPlugin({
prettyPrint: true,
filename: 'assets.json',
path: path.resolve(__dirname, 'build')
})
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment