- Introduces new
@index
alias, which allows for script and/or payload variations per index file@index
resolves to a directory that is the index file name without the .html extension. For example, if compiling a build forindex_onchannel.html
,@index
would resolve toindex_onchannel
- If no file exists after
@index
is resolved, it simply falls back to the parent directory that would have held the index folder. For example, if importing from./images/@index/pic.jpg
and no index-specific folders exists, the resolver will import from./images/pic.jpg
instead and let the developer know - If the resolver still can't find a file after falling back to the parent directory, Webpack will import an error about being unable to resolve the file, per usual
- Updated all of our Webpack plugins to use the new plugin/Tapable API
- Updated Deploy Manager to use these Webpack 4 plugins as well as using this Uglify plugin since Uglify is no longer included within Webpack's core package
- Adjusted wp-plugin-asset's recursive binary asset finding for Webpack's new internal graph representation
- Using Webpack 4 modes:
development
in debug settings, which seems to only include plugins that work with HMRproduction
in production settings, which contain plugins focused on optimization, such as on file size or browser performance- more notes on mode and mode-specific plugins available here
- If one reinstalls the packaging dependencies from a project that still uses Webpack 3 and uses "latest" on the packaging dependencies, this will cause compiling to break, signaling a need to migrate
- Newly built ads would have different packaging dependencies but should still work independently of the Ad Framework dependencies
If the watch process hangs for longer than 10 seconds, copy and run the watch command in a Terminal window. If an error that reads "Cannot read property 'watchRun' of undefined" shows up that prevents the compiling process from continuing, that means that your packaging is out of date.
Go ahead and:
- Run the Ad App feature: "Update ES6 Packaging"
- Delete the current
node_modules
folder andpackage-lock.json
file - Reinstall dependencies with
npm install
These steps should get you in sync with the updated packaging dependencies.
- merge Webpack 4 changes to master, bump major versions of Deploy Manager and Webpack plugins, AND update deployed build sources
- Start using updating semver versions in packaging package.json to better avoid breaking changes in the future
- Let devs know that we've updated to Webpack 4
- Prepare for any older ads using Webpack 3 breaking when reinstalling
- Put in fallback, if possible - does not seem feasible, using Webpack 4 FAT plugins with Webpack 3 fallbacks causes the compilation to end at the build assets copying w/o throwing an error