Skip to content

Commit

Permalink
fix(webpack.config.template.js): monorepo resolve root only
Browse files Browse the repository at this point in the history
  • Loading branch information
jbockle committed Nov 14, 2018
1 parent aedc74a commit a3fdc94
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions lib/resources/content/webpack.config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ const cssRules = [
// @if cssProcessor.id='postcss'
{
loader: 'postcss-loader',
options: { plugins: () => [require('autoprefixer')({ browsers: ['last 2 versions'] })]}
options: { plugins: () => [require('autoprefixer')({ browsers: ['last 2 versions'] })] }
}
// @endif
];

module.exports = ({production, server, extractCss, coverage, analyze, karma} = {}) => ({
module.exports = ({ production, server, extractCss, coverage, analyze, karma } = {}) => ({
resolve: {
// @if transpiler.id='typescript'
extensions: ['.ts', '.js'],
// @endif
// @if transpiler.id='babel'
extensions: ['.js'],
// @endif
modules: [srcDir, 'node_modules'],
modules: [srcDir, nodeModulesDir],
// Enforce single aurelia-binding, to avoid v1/v2 duplication due to
// out-of-date dependencies on 3rd party aurelia plugins
alias: { 'aurelia-binding': path.resolve(__dirname, 'node_modules/aurelia-binding') }
Expand All @@ -57,7 +57,7 @@ module.exports = ({production, server, extractCss, coverage, analyze, karma} = {
optimization: {
// Use splitChunks to breakdown the vendor bundle into smaller files
// https://webpack.js.org/plugins/split-chunks-plugin/
splitChunks: {
splitChunks: {
chunks: "initial",
cacheGroups: {
default: false, // Disable the built-in groups (default and vendors)
Expand Down Expand Up @@ -121,8 +121,8 @@ module.exports = ({production, server, extractCss, coverage, analyze, karma} = {
test: /\.css$/i,
issuer: [{ not: [{ test: /\.html$/i }] }],
use: extractCss ? [{
loader: MiniCssExtractPlugin.loader
},
loader: MiniCssExtractPlugin.loader
},
'css-loader'
] : ['style-loader', ...cssRules]
},
Expand Down Expand Up @@ -171,8 +171,9 @@ module.exports = ({production, server, extractCss, coverage, analyze, karma} = {
// @endif
{ test: /\.html$/i, loader: 'html-loader' },
// @if transpiler.id='babel'
{ test: /\.js$/i, loader: 'babel-loader', exclude: nodeModulesDir,
options: coverage ? { sourceMap: 'inline', plugins: [ 'istanbul' ] } : {},
{
test: /\.js$/i, loader: 'babel-loader', exclude: nodeModulesDir,
options: coverage ? { sourceMap: 'inline', plugins: ['istanbul'] } : {},
},
// @endif
// @if transpiler.id='typescript'
Expand Down Expand Up @@ -202,7 +203,7 @@ module.exports = ({production, server, extractCss, coverage, analyze, karma} = {
'Promise': 'bluebird'
}),
new ModuleDependenciesPlugin({
'aurelia-testing': [ './compile-spy', './view-spy' ]
'aurelia-testing': ['./compile-spy', './view-spy']
}),
new HtmlWebpackPlugin({
template: 'index.ejs',
Expand Down

0 comments on commit a3fdc94

Please sign in to comment.