Skip to content

Commit 7ddba22

Browse files
authored
Merge pull request #28 from icelam/develop
Merge branch 'develop' into master
2 parents 1908eec + 4a2d9b7 commit 7ddba22

File tree

9 files changed

+95
-27
lines changed

9 files changed

+95
-27
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"overrides": [
4141
{
42-
"files": ["scripts/*.js"],
42+
"files": ["scripts/*.js", "test/**/*.js"],
4343
"env": { "node": true },
4444
"rules": {
4545
"@typescript-eslint/no-var-requires": ["off"],

.github/workflows/pull-request.yml renamed to .github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
name: Build test
2-
on: [pull_request]
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- develop
7+
tags-ignore:
8+
- '**' #prevent double build on release tag
9+
pull_request:
10+
branches:
11+
- '**'
312

413
jobs:
5-
check:
6-
name: Build
14+
test:
15+
name: Test
716
runs-on: ubuntu-18.04
817
steps:
918
- name: Checkout repo
@@ -23,9 +32,15 @@ jobs:
2332
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
2433
restore-keys: |
2534
${{ runner.os }}-yarn-
35+
- name: Install webpack-cli
36+
run: |
37+
yarn add -P webpack-cli
2638
- name: Install dependencies
2739
run: |
2840
yarn install --frozen-lockfile
29-
- name: Build
41+
- name: Build package
3042
run: |
3143
yarn build
44+
- name: Test
45+
run: |
46+
webpack --config test/cases/v4/simple/webpack.config.js

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ yarn-debug.log*
55
yarn-error.log*
66

77
/dist
8+
/test/**/*/dist

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ yarn-error.log
1212
yarn.lock
1313
.github
1414
lgtm.yml
15+
/test

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![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)
44
[![Download count](https://img.shields.io/npm/dm/html-inline-script-webpack-plugin)](https://www.npmjs.com/package/html-inline-script-webpack-plugin)
55
[![Install size](https://packagephobia.com/badge?p=html-inline-script-webpack-plugin)](https://packagephobia.com/result?p=html-inline-script-webpack-plugin)
6-
![Build test](https://github.com/icelam/html-inline-script-webpack-plugin/workflows/Build%20test/badge.svg)
6+
![ci](https://github.com/icelam/html-inline-script-webpack-plugin/workflows/ci/badge.svg)
77
[![Package quality](https://npm.packagequality.com/shield/html-inline-script-webpack-plugin.svg)](https://packagequality.com/#?package=html-inline-script-webpack-plugin)
88

99
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.

test/cases/v4/simple/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<meta name="language" content="English" />
7+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
8+
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
9+
<title>webpack test</title>
10+
</head>
11+
<body>
12+
<p>This is minimal code to demonstrate webpack usage</p>
13+
</body>
14+
</html>

test/cases/v4/simple/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// eslint-disable-next-line no-console
2+
console.log('Hello world');
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const path = require('path');
2+
const HtmlWebpackPlugin = require('html-webpack-plugin');
3+
const Self = require('../../../../dist');
4+
5+
module.exports = {
6+
mode: 'production',
7+
entry: path.join(__dirname, './index.js'),
8+
output: {
9+
path: path.join(__dirname, './dist'),
10+
filename: 'index.js'
11+
},
12+
plugins: [
13+
new HtmlWebpackPlugin({
14+
template: path.resolve(__dirname, './index.html')
15+
}),
16+
new Self()
17+
]
18+
};

yarn.lock

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,14 @@ braces@^3.0.1:
576576
dependencies:
577577
fill-range "^7.0.1"
578578

579+
call-bind@^1.0.0:
580+
version "1.0.2"
581+
resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c"
582+
integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==
583+
dependencies:
584+
function-bind "^1.1.1"
585+
get-intrinsic "^1.0.2"
586+
579587
caller-callsite@^2.0.0:
580588
version "2.0.0"
581589
resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134"
@@ -717,10 +725,10 @@ [email protected]:
717725
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
718726
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
719727

720-
confusing-browser-globals@^1.0.9:
721-
version "1.0.9"
722-
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.9.tgz#72bc13b483c0276801681871d4898516f8f54fdd"
723-
integrity sha512-KbS1Y0jMtyPgIxjO7ZzMAuUpAKMt1SzCL9fsrKsX6b0zJPTaT0SiSPmewwVZg9UAO83HVIlEhZF84LIjZ0lmAw==
728+
confusing-browser-globals@^1.0.10:
729+
version "1.0.10"
730+
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.10.tgz#30d1e7f3d1b882b25ec4933d1d1adac353d20a59"
731+
integrity sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==
724732

725733
contains-path@^0.1.0:
726734
version "0.1.0"
@@ -850,7 +858,7 @@ deep-is@^0.1.3:
850858
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
851859
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
852860

853-
define-properties@^1.1.2, define-properties@^1.1.3:
861+
define-properties@^1.1.3:
854862
version "1.1.3"
855863
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
856864
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
@@ -944,12 +952,12 @@ escape-string-regexp@^1.0.5:
944952
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
945953

946954
eslint-config-airbnb-base@^14.2.0:
947-
version "14.2.0"
948-
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.0.tgz#fe89c24b3f9dc8008c9c0d0d88c28f95ed65e9c4"
949-
integrity sha512-Snswd5oC6nJaevs3nZoLSTvGJBvzTfnBqOIArkf3cbyTyq9UD79wOk8s+RiL6bhca0p/eRO6veczhf6A/7Jy8Q==
955+
version "14.2.1"
956+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz#8a2eb38455dc5a312550193b319cdaeef042cd1e"
957+
integrity sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==
950958
dependencies:
951-
confusing-browser-globals "^1.0.9"
952-
object.assign "^4.1.0"
959+
confusing-browser-globals "^1.0.10"
960+
object.assign "^4.1.2"
953961
object.entries "^1.1.2"
954962

955963
eslint-import-resolver-node@^0.3.4:
@@ -1264,6 +1272,15 @@ get-caller-file@^2.0.1:
12641272
resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
12651273
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
12661274

1275+
get-intrinsic@^1.0.2:
1276+
version "1.0.2"
1277+
resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.0.2.tgz#6820da226e50b24894e08859469dc68361545d49"
1278+
integrity sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==
1279+
dependencies:
1280+
function-bind "^1.1.1"
1281+
has "^1.0.3"
1282+
has-symbols "^1.0.1"
1283+
12671284
get-own-enumerable-property-symbols@^3.0.0:
12681285
version "3.0.2"
12691286
resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664"
@@ -1369,7 +1386,7 @@ has-flag@^4.0.0:
13691386
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
13701387
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
13711388

1372-
has-symbols@^1.0.0, has-symbols@^1.0.1:
1389+
has-symbols@^1.0.1:
13731390
version "1.0.1"
13741391
resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8"
13751392
integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==
@@ -1899,20 +1916,20 @@ object-inspect@^1.7.0:
18991916
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.8.0.tgz#df807e5ecf53a609cc6bfe93eac3cc7be5b3a9d0"
19001917
integrity sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==
19011918

1902-
object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1:
1919+
object-keys@^1.0.12, object-keys@^1.1.1:
19031920
version "1.1.1"
19041921
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
19051922
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
19061923

1907-
object.assign@^4.1.0:
1908-
version "4.1.0"
1909-
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da"
1910-
integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==
1924+
object.assign@^4.1.0, object.assign@^4.1.2:
1925+
version "4.1.2"
1926+
resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940"
1927+
integrity sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==
19111928
dependencies:
1912-
define-properties "^1.1.2"
1913-
function-bind "^1.1.1"
1914-
has-symbols "^1.0.0"
1915-
object-keys "^1.0.11"
1929+
call-bind "^1.0.0"
1930+
define-properties "^1.1.3"
1931+
has-symbols "^1.0.1"
1932+
object-keys "^1.1.1"
19161933

19171934
object.entries@^1.1.2:
19181935
version "1.1.2"

0 commit comments

Comments
 (0)