Skip to content

Instantly share code, notes, and snippets.

@daniellizik
Created March 25, 2017 14:52
Show Gist options
  • Save daniellizik/46bfc8a787908272ca3c5a60c04490a8 to your computer and use it in GitHub Desktop.
Save daniellizik/46bfc8a787908272ca3c5a60c04490a8 to your computer and use it in GitHub Desktop.
webpack2 config
const webpack = require('webpack')
module.exports = {
devtool: 'inline-source-map',
entry: `${__dirname}/../src/index.js`,
output: {
publicPath: '/',
filename: 'bundle.js'
},
module: {
rules: [
{
test: /\.js$|\.jsx$/,
exclude: /node_modules/,
use: ['babel-loader']
},
{
test: /\.json$/,
use: ['json-loader']
},
{
test: /\.html$/,
use: ['html-loader']
}
]
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify(process.env.NODE_ENV) }
})
],
target: 'web'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment