Skip to content

Commit

Permalink
fix: conditionally install terser-webpack-plugin for webpack@next (#1732
Browse files Browse the repository at this point in the history
)
  • Loading branch information
anshumanv authored Aug 4, 2020
1 parent a380a78 commit e68619d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ jobs:
- name: Install webpack ${{ matrix.webpack-version }}
run: yarn add -W webpack@${{ matrix.webpack-version }}

- name: Install latest terser-webpack-plugin for webpack 5
if: ${{ matrix.webpack-version == 'next' }}
run: yarn add -W terser-webpack-plugin --dev

- name: Build
run: yarn build

Expand Down
6 changes: 6 additions & 0 deletions test/core-flags/optimization-flags.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ describe('optimization config related flag', () => {
if (flag.name === 'optimization-split-chunks-chunks') {
stdout = run(__dirname, [`--${flag.name}`, 'initial']).stdout;
expect(stdout).toContain(`chunks: 'initial'`);
} else if (flag.name === 'optimization-mangle-exports') {
stdout = run(__dirname, ['--optimization-mangle-exports', 'size']).stdout;
expect(stdout).toContain(`mangleExports: 'size'`);
} else if (flag.name === 'optimization-used-exports') {
stdout = run(__dirname, ['--optimization-used-exports', 'global']).stdout;
expect(stdout).toContain(`usedExports: 'global'`);
} else {
expect(stdout).toContain(`${propName}: 'named'`);
}
Expand Down

0 comments on commit e68619d

Please sign in to comment.