Skip to content

Commit bd69e5e

Browse files
committed
feat: check duplicated packages in webpack
aurelia/binding#702 this is a safe check to warn user about duplicated aurelia-binding v1 and v2 (and potentially other duplicates).
1 parent 2bb862e commit bd69e5e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

lib/commands/new/buildsystems/webpack/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ module.exports = function(project, options) {
5151
'copy-webpack-plugin',
5252
'mini-css-extract-plugin',
5353
'aurelia-webpack-plugin',
54+
'duplicate-package-checker-webpack-plugin',
5455
'webpack',
5556
'webpack-cli',
5657
'webpack-dev-server',

lib/dependencies.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"css-loader": "^0.28.11",
4242
"debounce": "^1.1.0",
4343
"del": "^3.0.0",
44+
"duplicate-package-checker-webpack-plugin": "^3.0.0",
4445
"event-stream": "^3.3.4",
4546
"expose-loader": "^0.7.5",
4647
"mini-css-extract-plugin": "^0.4.1",

lib/resources/content/webpack.config.template.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require('path');
22
const HtmlWebpackPlugin = require('html-webpack-plugin');
33
const CopyWebpackPlugin = require('copy-webpack-plugin');
44
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
5+
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
56
const project = require('./aurelia_project/aurelia.json');
67
const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin');
78
const { ProvidePlugin } = require('webpack');
@@ -79,15 +80,15 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
7980
use: cssRules
8081
},
8182
// @if cssProcessor.id='less'
82-
{
83-
test: /\.less$/i,
83+
{
84+
test: /\.less$/i,
8485
use: ['style-loader', 'css-loader', 'less-loader'],
8586
issuer: /\.[tj]s$/i
8687
},
87-
{
88-
test: /\.less$/i,
88+
{
89+
test: /\.less$/i,
8990
use: ['css-loader', 'less-loader'],
90-
issuer: /\.html?$/i
91+
issuer: /\.html?$/i
9192
},
9293
// @endif
9394
// @if cssProcessor.id='stylus'
@@ -99,7 +100,7 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
99100
{
100101
test: /\.styl$/i,
101102
use: ['css-loader', 'stylus-loader'],
102-
issuer: /\.html?$/i
103+
issuer: /\.html?$/i
103104
},
104105
// @endif
105106
// @if cssProcessor.id='sass'
@@ -141,6 +142,7 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
141142
]
142143
},
143144
plugins: [
145+
new DuplicatePackageCheckerPlugin(),
144146
new AureliaPlugin(),
145147
new ProvidePlugin({
146148
'Promise': 'bluebird'

0 commit comments

Comments
 (0)