Skip to content

Commit

Permalink
Merge pull request #39 from ice-lab/ice-scripts/release-2.1.8
Browse files Browse the repository at this point in the history
ice-scripts/release 2.1.8
  • Loading branch information
imsobear authored Aug 8, 2019
2 parents 308354f + a849c41 commit c7aa512
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.8

- [fix] add polyfill when entry path include node_modules

## 2.1.7

- [fix] add polyfill when entry modified by plugin
Expand Down
5 changes: 5 additions & 0 deletions packages/ice-scripts/lib/config/processEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ module.exports = (config, options = {}) => {
if (options.polyfill) {
const rule = config.module.rule('polyfill').test(/\.jsx?|\.tsx?$/);
Object.keys(entries).forEach((key) => {
let addPolyfill = false;
// only include entry path
for (let i = 0; i < entries[key].length; i += 1) {
// filter node_modules file add by plugin
if (!/node_modules/.test(entries[key][i])) {
rule.include.add(entries[key][i]);
addPolyfill = true;
break;
}
}
if (!addPolyfill) {
rule.include.add(entries[key][0]);
}
});
rule.use('polyfill-loader').loader(require.resolve('../utils/polyfillLoader')).options({});

Expand Down
2 changes: 1 addition & 1 deletion packages/ice-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ice-scripts",
"version": "2.1.7",
"version": "2.1.8",
"description": "ICE SDK",
"main": "index.js",
"bin": {
Expand Down

0 comments on commit c7aa512

Please sign in to comment.