diff --git a/_dev/js/jquery.js b/_dev/js/jquery.js new file mode 100644 index 00000000..05678e94 --- /dev/null +++ b/_dev/js/jquery.js @@ -0,0 +1 @@ +import 'jquery'; // ONLY FOR CHUNK diff --git a/_dev/js/theme.js b/_dev/js/theme.js index 76b4cdb1..e3cfd59b 100644 --- a/_dev/js/theme.js +++ b/_dev/js/theme.js @@ -1,3 +1 @@ -import 'jquery'; // ONLY FOR CHUNK - import './theme/index'; diff --git a/_dev/js/theme/index.js b/_dev/js/theme/index.js index 92829dc9..4bf1efb2 100644 --- a/_dev/js/theme/index.js +++ b/_dev/js/theme/index.js @@ -2,7 +2,7 @@ import EventEmitter from 'events'; import './windowExpose'; import './core/index'; -import './vendors/bootstrap/bootstrap-imports'; +import './vendors/index'; import './components/dynamic-bootstrap-components'; import bsCustomFileInput from 'bs-custom-file-input'; import './components/header/index'; diff --git a/_dev/js/theme/vendors/index.js b/_dev/js/theme/vendors/index.js new file mode 100644 index 00000000..39fc41d3 --- /dev/null +++ b/_dev/js/theme/vendors/index.js @@ -0,0 +1 @@ +import './bootstrap/bootstrap-imports'; diff --git a/_dev/webpack/webpack.parts.js b/_dev/webpack/webpack.parts.js index 300a6edc..3f2e1487 100644 --- a/_dev/webpack/webpack.parts.js +++ b/_dev/webpack/webpack.parts.js @@ -158,12 +158,6 @@ exports.extractVendorsChunks = () => ({ filename: 'js/swipervendor.js', chunks: 'initial', }, - jquery: { - test: /[\\/]node_modules[\\/](jquery)[\\/]/, - name: 'jquery', - filename: 'js/jquery.js', - chunks: 'initial', - }, shared: { name: 'shared', chunks: 'initial', diff --git a/_dev/webpack/webpack.production.js b/_dev/webpack/webpack.production.js index fa84a26a..ed216f4d 100644 --- a/_dev/webpack/webpack.production.js +++ b/_dev/webpack/webpack.production.js @@ -11,6 +11,7 @@ const plugins = (purge, analyze) => ([ new EsbuildPlugin({ target: 'es2016', format: 'iife', + minify: true, }), analyze ? new BundleAnalyzerPlugin() : false, purge ? new PurgeCSSPlugin({ diff --git a/_dev/webpack/webpack.vars.js b/_dev/webpack/webpack.vars.js index 33e9dd9f..3004df44 100644 --- a/_dev/webpack/webpack.vars.js +++ b/_dev/webpack/webpack.vars.js @@ -67,6 +67,8 @@ exports.webpackVars = { ] } + resultEntries.jquery = path.resolve(themeDev, `./js/jquery.js`); + return resultEntries; }, getOutput: ({ mode, publicPath, siteURL, port, devServer }) => ({ diff --git a/config/assets.yml b/config/assets.yml index aaccccff..17c00894 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -30,9 +30,9 @@ js: runtime: # This file is only used to handle HMR for multiple entry points fileName: runtime.js priority: 1 - jquery: - fileName: jquery.js - priority: 1 +# jquery: # Uncomment this if you want to use jQuery +# fileName: jquery.js +# priority: 1 shared: # Shared code between all pages autogenerated by Webpack fileName: shared.js priority: 1