Skip to content

Commit

Permalink
Merge pull request #905 from huochunpeng/check-duplicated-webpack-pac…
Browse files Browse the repository at this point in the history
…kages

feat: check duplicated packages in webpack
  • Loading branch information
JeroenVinke authored Jul 26, 2018
2 parents d5135af + bd69e5e commit 4d9f026
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/commands/new/buildsystems/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = function(project, options) {
'copy-webpack-plugin',
'mini-css-extract-plugin',
'aurelia-webpack-plugin',
'duplicate-package-checker-webpack-plugin',
'webpack',
'webpack-cli',
'webpack-dev-server',
Expand Down
1 change: 1 addition & 0 deletions lib/dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"css-loader": "^0.28.11",
"debounce": "^1.1.0",
"del": "^3.0.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",
"event-stream": "^3.3.4",
"expose-loader": "^0.7.5",
"mini-css-extract-plugin": "^0.4.1",
Expand Down
14 changes: 8 additions & 6 deletions lib/resources/content/webpack.config.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
const project = require('./aurelia_project/aurelia.json');
const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin');
const { ProvidePlugin } = require('webpack');
Expand Down Expand Up @@ -82,15 +83,15 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
use: cssRules
},
// @if cssProcessor.id='less'
{
test: /\.less$/i,
{
test: /\.less$/i,
use: ['style-loader', 'css-loader', 'less-loader'],
issuer: /\.[tj]s$/i
},
{
test: /\.less$/i,
{
test: /\.less$/i,
use: ['css-loader', 'less-loader'],
issuer: /\.html?$/i
issuer: /\.html?$/i
},
// @endif
// @if cssProcessor.id='stylus'
Expand All @@ -102,7 +103,7 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
{
test: /\.styl$/i,
use: ['css-loader', 'stylus-loader'],
issuer: /\.html?$/i
issuer: /\.html?$/i
},
// @endif
// @if cssProcessor.id='sass'
Expand Down Expand Up @@ -144,6 +145,7 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
]
},
plugins: [
new DuplicatePackageCheckerPlugin(),
new AureliaPlugin(),
new ProvidePlugin({
'Promise': 'bluebird'
Expand Down

0 comments on commit 4d9f026

Please sign in to comment.