Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: test on webpack-plugin v5
  • Loading branch information
SimenB committed Feb 20, 2021
commit 16fc528ab878ce519286f47bc7f053e60c0311ca
44 changes: 43 additions & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,48 @@ jobs:
run: |
yarn
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }}
git checkout
- name: run tests
run: yarn cover
- uses: codecov/codecov-action@v1
if: ${{ always() }}
test-node-webpack-5:
name:
# prettier-ignore
Test on Node.js v${{ matrix.node-version }} and html-webpack-plugin v${{ matrix.html-plugin-version }} and webpack v${{ matrix.webpack-version }}
strategy:
fail-fast: false
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
html-plugin-version: [4, 5]
webpack-version: [4, 5]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# prettier-ignore
- name: install with html-webpack-plugin v${{matrix.html-plugin-version }} and webpack v${{ matrix.webpack-version }}
run: |
yarn
yarn add --dev html-webpack-plugin@${{matrix.html-plugin-version }} webpack@${{ matrix.webpack-version }}
git checkout

- name: run tests
run: yarn cover
- uses: codecov/codecov-action@v1
Expand Down Expand Up @@ -127,7 +169,7 @@ jobs:
# prettier-ignore
${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
name: Release new version
needs: [lint, test-node, test-os, test-browser]
needs: [lint, test-node, test-node-webpack-5, test-os, test-browser]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"webpack-cli": "^3.1.0"
},
"peerDependencies": {
"html-webpack-plugin": "^3.0.4 || ^4.0.0-0",
"webpack": "^4.0.0"
"html-webpack-plugin": "^3.0.4 || ^4.0.0-0 || ^5.0.0-0",
"webpack": "^4.0.0 || ^5.0.0"
},
"engines": {
"node": ">=6"
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const fsReadFileAsync = promisify(fs.readFile);

/**
* Pushes the content of the given filename to the compilation assets
* @param {string} resolvedFilename
* @param {string} filename
* @param {WebpackCompilation} compilation
* @returns {string} file basename
* @returns {Promise<string>} file basename
*/
function addFileToAssetsWebpack5(filename, compilation) {
const resolvedFilename = path.resolve(compilation.compiler.context, filename);
Expand Down