Skip to content

Commit

Permalink
feat: check duplicated packages in webpack
Browse files Browse the repository at this point in the history
aurelia/binding#702 this is a safe check to warn user about duplicated aurelia-binding v1 and v2 (and potentially other duplicates).
  • Loading branch information
3cp committed Jul 26, 2018
1 parent 2bb862e commit bd69e5e
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 @@ -79,15 +80,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 @@ -99,7 +100,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 @@ -141,6 +142,7 @@ module.exports = ({production, server, extractCss, coverage, analyze} = {}) => (
]
},
plugins: [
new DuplicatePackageCheckerPlugin(),
new AureliaPlugin(),
new ProvidePlugin({
'Promise': 'bluebird'
Expand Down

0 comments on commit bd69e5e

Please sign in to comment.