Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 36ce984

Browse files
authored
Merge pull request #3 from donskov/dev
Update package.json, replace file support regexp
2 parents 88ef676 + a5605e3 commit 36ce984

File tree

6 files changed

+6
-154
lines changed

6 files changed

+6
-154
lines changed

.npmignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
test
22
*.yml
3-
src
43
.eslintrc
54
.gitignore

dist/index.js

Lines changed: 0 additions & 123 deletions
This file was deleted.

dist/utils/errors.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "static-render-html-webpack-plugin",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "Simplifies creation of HTML static files using webpack",
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "babel ./src --out-dir ./dist",
88
"test": "mocha test/index.js --compilers js:babel-register",
9+
"postinstall": "npm run build",
910
"prebuild": "rimraf dist",
1011
"test:watch": "npm t -- --watch"
1112
},

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ class StaticRenderHtmlWebpackPlugin {
1313
constructor(options) {
1414
this.options = Object.assign({}, {
1515
entry: '',
16-
pretty: true,
16+
pretty: false,
1717
}, options);
1818
}
1919

2020
apply(compiler) {
2121
const entry = this.options.entry;
22-
const FILE_SUPPORT_REGEXP = /.(js|jsx)$/g;
2322

2423
compiler.plugin('emit', (compilation, callback) => {
2524
let result = '';
@@ -32,6 +31,7 @@ class StaticRenderHtmlWebpackPlugin {
3231
let fileExtension = entry.split('.');
3332
fileExtension = `.${fileExtension[fileExtension.length - 1]}`;
3433

34+
const FILE_SUPPORT_REGEXP = /.(js|jsx)$/g;
3535
if (!FILE_SUPPORT_REGEXP.test(fileExtension)) {
3636
compilation.errors.push(prettyError.fileExtension(entry, compiler.context));
3737
return callback();

test/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ describe('Static Render Html Webpack Plugin', () => {
7777
const entry = path.join(__dirname, './fixtures/main.jsx');
7878
config.plugins = [new StaticRenderHtmlWebpackPlugin({
7979
entry,
80+
pretty: true,
8081
})];
8182

8283
const expectHtmlNames = [
@@ -92,6 +93,7 @@ describe('Static Render Html Webpack Plugin', () => {
9293
const entry = path.join(__dirname, './fixtures/multiple_html.jsx');
9394
config.plugins = [new StaticRenderHtmlWebpackPlugin({
9495
entry,
96+
pretty: true,
9597
})];
9698

9799
const expectHtmlNames = [

0 commit comments

Comments
 (0)