-
Notifications
You must be signed in to change notification settings - Fork 77
chore: optimise webpack config for examples #98
Conversation
| import 'bootstrap/dist/css/bootstrap.min.css'; | ||
| //import '../src/themes/default/index.scss'; | ||
| //import '../src/themes/sugar/index.scss'; | ||
| import '../src/themes/bootstrap/index.scss' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specify source SCSS files directly in HTML
examples/index.scss
Outdated
| @use 'bootstrap/dist/css/bootstrap.min'; | ||
| //@use '../src/themes/default/index.scss'; | ||
| //@use '../src/themes/sugar/index.scss'; | ||
| @use '../src/themes/bootstrap/index.scss' No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create the separate SCSS file to bundle many other CSS/SCSS files
| module.exports.optimization.minimizer.push( | ||
| new TerserPlugin({ | ||
| include: /\.min\.js$/, | ||
| extractComments: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Bundler Plugin already has the extractComments option, defaults is false to avoid extraction of files like *.LICENSE.txt
| new TerserPlugin({ | ||
| include: /\.min\.js$/, | ||
| extractComments: false, | ||
| include: /\.js$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix the JS file extension to generate minimised JS files in docs/ directory
|
Hey, |
You can try the forked branch: Generate static production files: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #98 +/- ##
=======================================
Coverage 67.13% 67.13%
=======================================
Files 6 6
Lines 143 143
Branches 40 41 +1
=======================================
Hits 96 96
Misses 47 47 ☔ View full report in Codecov by Sentry. |
Hello @ankurk91 ,
I'm the author of the webpack-remove-empty-scripts that is used in your project.
I want to demonstrate my other html-bundler-webpack-plugin that simplify the Webpack configuration
to generate HTML with assets from source files (templates, scripts, styles, images, fonts, etc.).
The
html-bundler-webpack-pluginis the best modern alternative tohtml-webpack-plugin.Using the Bundler Plugin, an entry point is an HTML template.
All your source asset files (scripts, styles, images, etc.) can be specified directly in the HTML template using
<script>and<link>tags.The plugin resolves source files of assets in templates and replaces them with correct output URLs in the generated HTML.
The resolved assets will be processed via Webpack plugins/loaders and placed into the output directory.
Using the bundler plugin:
<script>and<link>.hrefsrcsrcsetetc.Your profit