-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: webpack config for dll plugin #52
Conversation
ClarkXia
commented
Aug 26, 2019
•
edited
Loading
edited
- fix: get default webpack config for build dll
- fix: html template
- fix: dll plugin only active in dev mode
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.
Looks good! Just some comments.
return; | ||
const hasVendor = (Array.from($('script')) || []).some(script => script.attribs.src === 'vendor.dll.js'); | ||
if (!hasVendor) { | ||
$('body').append('<script data-id="dll" src="vendor.dll.js"></script>'); |
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.
src="vendor.dll.js"
Should this be vendor.js
instead?
Note to self: Added data-id="dll"
to differentiate between scripts added by the DllPlugin and scripts added by default to the index.html 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.
If we want to use vendor.dll.js
, we need to specify something like this in the webpack config:
output: {
filename: '[name].dll.js',
...
}
} | ||
|
||
// Check if vendor.js is included inside the HTML file | ||
if ($('script').length === 1 && $('script')[0].attribs.src === "vendor.js") { | ||
return; | ||
const hasVendor = (Array.from($('script')) || []).some(script => script.attribs.src === 'vendor.dll.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.
script.attribs.src === 'vendor.dll.js'
Should this be vendor.js
instead?
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.
If we want to use vendor.dll.js, we need to specify something like this in the webpack config:
output: {
filename: '[name].dll.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.
fixed
* chore: version * chore: remove index.js (#40) * fix: deep copy babelConfig from webpack config * chore: rename typos (#45) * fix: set proxy headers when proxy server error (#47) * fix: set proxy headers when proxy server error * feat: only set enable: false will disable proxy * chore: eslint * feat: support calculate color variables for multi-theme (#44) * chore: add package resolve-sass-import * feat: support calculate color variables for @alifd/next * chore: version * chore: remove console log * chore: comment for regex * chore: rename typo and add readme example * fix: check match result * feat: support DllPlugin in ice-scripts (#48) * feat: support DllPlugin * chore: fix review comments * chore: refactor code * chore: fix review comments * fix: webpack config for dll plugin (#52) * fix: webpack config for dll plugin * fix: html template for dll * chore: typo and remove useless comment * fix: renanme dll output filename * feat: refactor webpack-dev-mock (#50) * feat: support index.ts * feat: dev mock is before devServer * chore: update verison * fix: hot reload mock * chore: adjust verison * style: code formatter * chore: add changelog.md * chore: adjust log verison * chore: changlog * style: code formatter (#54)