Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"overrides": [
{
"files": ["scripts/*.js"],
"files": ["scripts/*.js", "test/**/*.js"],
"env": { "node": true },
"rules": {
"@typescript-eslint/no-var-requires": ["off"],
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/pull-request.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: Build test
on: [pull_request]
name: ci
on:
push:
branches:
- master
- develop
tags-ignore:
- '**' #prevent double build on release tag
pull_request:
branches:
- '**'

jobs:
check:
name: Build
test:
name: Test
runs-on: ubuntu-18.04
steps:
- name: Checkout repo
Expand All @@ -23,9 +32,15 @@ jobs:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install webpack-cli
run: |
yarn add -P webpack-cli
- name: Install dependencies
run: |
yarn install --frozen-lockfile
- name: Build
- name: Build package
run: |
yarn build
- name: Test
run: |
webpack --config test/cases/v4/simple/webpack.config.js
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ yarn-debug.log*
yarn-error.log*

/dist
/test/**/*/dist
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ yarn-error.log
yarn.lock
.github
lgtm.yml
/test
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Latest version](https://img.shields.io/github/v/release/icelam/html-inline-script-webpack-plugin.svg?sort=semver&label=latest)](https://github.com/icelam/html-inline-script-webpack-plugin/releases)
[![Download count](https://img.shields.io/npm/dm/html-inline-script-webpack-plugin)](https://www.npmjs.com/package/html-inline-script-webpack-plugin)
[![Install size](https://packagephobia.com/badge?p=html-inline-script-webpack-plugin)](https://packagephobia.com/result?p=html-inline-script-webpack-plugin)
![Build test](https://github.com/icelam/html-inline-script-webpack-plugin/workflows/Build%20test/badge.svg)
![ci](https://github.com/icelam/html-inline-script-webpack-plugin/workflows/ci/badge.svg)
[![Package quality](https://npm.packagequality.com/shield/html-inline-script-webpack-plugin.svg)](https://packagequality.com/#?package=html-inline-script-webpack-plugin)

A webpack plugin for converting external script files `<script src="app.js"></script>` to inline script block `<script>...</script>`. Requires [html-webpack-plugin](https://github.com/jantimon/html-webpack-plugin) to work.
Expand Down
14 changes: 14 additions & 0 deletions test/cases/v4/simple/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="English" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
<title>webpack test</title>
</head>
<body>
<p>This is minimal code to demonstrate webpack usage</p>
</body>
</html>
2 changes: 2 additions & 0 deletions test/cases/v4/simple/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// eslint-disable-next-line no-console
console.log('Hello world');
18 changes: 18 additions & 0 deletions test/cases/v4/simple/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const Self = require('../../../../dist');

module.exports = {
mode: 'production',
entry: path.join(__dirname, './index.js'),
output: {
path: path.join(__dirname, './dist'),
filename: 'index.js'
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, './index.html')
}),
new Self()
]
};