Skip to content

Commit 48e04bb

Browse files
author
Adam Yost
authored
Merge pull request #2 from swimmadude66/dev
Merge in readme fix, plus actual config type and updated package-lock
2 parents 9d38401 + aa0b64d commit 48e04bb

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ src/
22
spec/
33
node_modules/
44
.vscode/
5+
.gitignore
56
npm-debug.log
67
tsconfig.json
78
.travis.yml

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
language: node_js
22
node_js:
33
- "8"
4-
- "9"
54
- "10"
6-
- "11"
75
- "12"
86

97
env:
108
- WEBPACK_VERSION=4 HTML_PLUGIN_VERSION=3
119
- WEBPACK_VERSION=4 HTML_PLUGIN_VERSION=next
10+
# - WEBPACK_VERSION=5.0.0-alpha.12 HTML_PLUGIN_VERSION=next
1211

1312
install:
1413
- npm install

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Webpack Nomodule Plugin
2-
_Assigns the nodmodule attribute to script tags injected by [Html Webpack Plugin](https://github.com/jantimon/html-webpack-plugin)_
2+
_Assigns the `nomodule` attribute to script tags injected by [Html Webpack Plugin](https://github.com/jantimon/html-webpack-plugin)_
33

44
## Configuration
55

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webpack-nomodule-plugin",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "a plugin for html-webpack-plugin to label certain chunks as legacy-only via the nomodule attribute",
55
"main": "dist/plugin.js",
66
"scripts": {

src/plugin.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import * as HtmlWebpackPlugin from 'html-webpack-plugin';
22
import * as minimatch from 'minimatch';
33

4+
export type NoModuleConfig = {
5+
filePatterns: string[];
6+
// in case I want to add other optional configs later without breaking old uses
7+
}
8+
49
export class WebpackNoModulePlugin {
510

6-
constructor(private _config: {filePatterns: string[]} = {filePatterns: []}) {
11+
constructor(private _config: NoModuleConfig = {filePatterns: []}) {
712

813
}
914

@@ -21,9 +26,9 @@ export class WebpackNoModulePlugin {
2126
return cb(null, data);
2227
}
2328
)
24-
} else if (HtmlWebpackPlugin && HtmlWebpackPlugin['getHooks']) {
29+
} else if (HtmlWebpackPlugin && HtmlWebpackPlugin.getHooks) {
2530
// html-webpack 4
26-
const hooks = (HtmlWebpackPlugin as any).getHooks(compilation);
31+
const hooks = HtmlWebpackPlugin.getHooks(compilation);
2732
hooks.alterAssetTags.tapAsync(
2833
'NoModulePlugin',
2934
(data, cb) => {

0 commit comments

Comments
 (0)