Created
December 11, 2018 23:32
-
-
Save eugenet8k/c1c5a1efc8c3078519ea87b10860df50 to your computer and use it in GitHub Desktop.
Webpack.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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