Skip to content

Commit

Permalink
2.4.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
JayCanuck committed Sep 4, 2019
2 parents 70afd9e + dd1dfb2 commit 64d942b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.4.1 (September 4, 2019)

* `SnapshotPlugin`: Fixed V8 snapshotting when `ilib` external package is not found.

# 2.4.0 (August 12, 2019)

* Redesigned `option-parser` with encapsulated theme option support and environment variable overriding.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@enact/dev-utils",
"version": "2.4.0",
"version": "2.4.1",
"description": "A collection of development utilities for Enact apps.",
"main": "index.js",
"author": "Jason Robitaille <jason.robitaille@lge.com>",
Expand Down
15 changes: 11 additions & 4 deletions plugins/SnapshotPlugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,18 @@ class SnapshotPlugin {
compiler.hooks.v8Snapshot = new SyncHook([]);

// Ignore packages that don't exists so snapshot helper can skip them
['ilib', '@enact/i18n', '@enact/moonstone', '@enact/core/snapshot'].forEach(lib => {
if (!fs.existsSync(path.join(app, 'node_modules', lib))) {
new IgnorePlugin(new RegExp(lib)).apply(compiler);
}
const ignoreContext = path.dirname(SnapshotPlugin.helperJS);
const missing = lib => !fs.existsSync(path.join(app, 'node_modules', lib));
const filter = lib => (resource, context) => {
return resource.startsWith(lib) && context === ignoreContext;
};
['@enact/i18n', '@enact/moonstone', '@enact/core/snapshot'].filter(missing).forEach(p => {
new IgnorePlugin({checkResource: filter(p)}).apply(compiler);
});
// ilib can be aliased to @enact/i18n/ilib, so verify both are missing before ignoring
if (['ilib', '@enact/i18n/ilib'].every(missing)) {
new IgnorePlugin({checkResource: filter('ilib')}).apply(compiler);
}

// Redirect external 'react-dom' import/require statements to the snapshot helper
compiler.hooks.normalModuleFactory.tap('SnapshotPlugin', factory => {
Expand Down

0 comments on commit 64d942b

Please sign in to comment.