Skip to content
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

Merged
merged 4 commits into from
Aug 27, 2019

Conversation

ClarkXia
Copy link
Collaborator

@ClarkXia ClarkXia commented Aug 26, 2019

  • fix: get default webpack config for build dll
  • fix: html template
  • fix: dll plugin only active in dev mode

@ClarkXia ClarkXia requested a review from tanhengyeow August 26, 2019 13:22
Copy link
Contributor

@tanhengyeow tanhengyeow left a 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>');
Copy link
Contributor

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.

Copy link
Contributor

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');
Copy link
Contributor

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?

Copy link
Contributor

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',
      ...
   }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@ClarkXia ClarkXia merged commit 70de595 into ice-scripts/release-2.1.10 Aug 27, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-plugin-dll branch August 27, 2019 09:15
imsobear pushed a commit that referenced this pull request Aug 27, 2019
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants