Skip to content

Instantly share code, notes, and snippets.

@eugenet8k
Created December 11, 2018 23:32
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 eugenet8k/c1c5a1efc8c3078519ea87b10860df50 to your computer and use it in GitHub Desktop.
Save eugenet8k/c1c5a1efc8c3078519ea87b10860df50 to your computer and use it in GitHub Desktop.
Webpack.config
webpack: {
// for istanbul code coverage, 'cheap-module-source-map' is required
devtool: 'cheap-module-source-map',
module: {
exprContextCritical: false,
noParse: /moment/,
rules: [
{
enforce: 'pre',
test: /\.hbs/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
failOnError: true,
outputReport: true
}
},
babelLoader,
coffeeLoader,
handlebarsLoader,
i18nLoader,
yamlLoader,
jQueryLoader,
{
test: /\.coffee|\.js$/,
enforce: 'post',
exclude: /node_modules|\.spec\.coffee|\.spec\.js$/,
use: {
loader: 'istanbul-instrumenter-loader',
options: {esModules: true}
}
},
svgLoader,
{
test: /\.(png|svg|woff|woff2|eot|ttf)$/,
exclude: resolve(__dirname, 'node_modules', '@gnosis'),
loader: 'null-loader'
}
]
},
plugins: [
// Moment.js bundles large locale files by default due to how Webpack
// interprets its code. This is a practical solution that requires the
// user to opt into importing specific locales.
// https://github.com/jmblog/how-to-optimize-momentjs-with-webpack
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.ProvidePlugin(provideModules),
nodeEnvPlugin(process.env.NODE_ENV)
]
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment