Skip to content

Instantly share code, notes, and snippets.

@jinglemansweep
Created August 24, 2017 12:03
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 jinglemansweep/fcc1758e530544bcafb333ba57b15eff to your computer and use it in GitHub Desktop.
Save jinglemansweep/fcc1758e530544bcafb333ba57b15eff to your computer and use it in GitHub Desktop.
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: {
app: './src/app/index.js'
},
plugins: [
new webpack.DefinePlugin({
ENV: JSON.stringify(process.env.NODE_ENV === 'production' ? 'production' : 'development')
})
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist')
},
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader'
}
},
{ test: /\.scss$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' }
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
'file-loader'
]
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment