Skip to content

Commit

Permalink
refactor(webpack): use entry not ProviderPlugin for promise polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
3cp committed Feb 19, 2020
1 parent 6539314 commit bf1c6f3
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions skeleton/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ 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');
// @if feat['scaffold-navigation']
const { ProvidePlugin } = require('webpack');
// @endif
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const CleanWebpackPlugin = require('clean-webpack-plugin');

Expand Down Expand Up @@ -67,7 +69,11 @@ module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, h
alias: { 'aurelia-binding': path.resolve(__dirname, 'node_modules/aurelia-binding') }
},
entry: {
app: ['aurelia-bootstrapper']
app: [
// Remove next line if you don't need to support IE11
'promise-polyfill/src/polyfill',
'aurelia-bootstrapper'
]
},
mode: production ? 'production' : 'development',
output: {
Expand Down Expand Up @@ -310,13 +316,14 @@ module.exports = ({ production } = {}, {extractCss, analyze, tests, hmr, port, h
plugins: [
...when(!tests, new DuplicatePackageCheckerPlugin()),
new AureliaPlugin(),
new ProvidePlugin({
// @if feat['scaffold-navigation']
$: 'jquery',
jQuery: 'jquery',
// @endif
'Promise': ['promise-polyfill', 'default']
new ProvidePlugin({
'jQuery': 'jquery',
'$': 'jquery',
'window.jQuery': 'jquery',
'window.$': 'jquery'
}),
// @endif
new ModuleDependenciesPlugin({
'aurelia-testing': ['./compile-spy', './view-spy']
}),
Expand Down

0 comments on commit bf1c6f3

Please sign in to comment.