Permalink
Browse files

fix(webpack.config.template.js): monorepo resolve root only

  • Loading branch information...
jbockle committed Nov 14, 2018
1 parent aedc74a commit a3fdc94342fc12a3880af658bb6a92bd18077e84
Showing with 10 additions and 9 deletions.
  1. +10 −9 lib/resources/content/webpack.config.template.js
@@ -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') }
@@ -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)
@@ -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]
},
@@ -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'
@@ -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',

0 comments on commit a3fdc94

Please sign in to comment.