-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: serialization issue when used the
cache.type = filesystem
, #73
- Loading branch information
Showing
26 changed files
with
275 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Test</title> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
<script src="main.6ad9992e.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("Hello World! Test: 123"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Test</title> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('Hello World! Test: 123'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const path = require('path'); | ||
const HtmlBundlerPlugin = require('html-bundler-webpack-plugin'); | ||
|
||
module.exports = { | ||
mode: 'production', | ||
//mode: 'development', | ||
stats: 'errors-warnings', | ||
|
||
output: { | ||
path: path.join(__dirname, 'dist/'), | ||
clean: true, | ||
}, | ||
|
||
plugins: [ | ||
new HtmlBundlerPlugin({ | ||
entry: { | ||
index: { | ||
import: './src/index.html', | ||
filename: (pathData) => { | ||
//console.log('\n\n*** entry.index.filename: : ', { pathData }); | ||
return '[name].html'; | ||
}, | ||
}, | ||
}, | ||
|
||
// filename: (pathData) => { | ||
// console.log('\n\n*** plugin.filename: : ', { pathData }); | ||
// return '[name].html'; | ||
// }, | ||
|
||
js: { | ||
filename: (pathData) => { | ||
//console.log('\n\n*** js.filename: : ', { pathData }); | ||
return '[name].[contenthash:8].js'; | ||
}, | ||
}, | ||
}), | ||
], | ||
|
||
// test filesystem cache | ||
cache: { | ||
type: 'filesystem', | ||
cacheDirectory: path.join(__dirname, '.cache'), | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Test | ||
|
||
Test the `cache.type` as `filesystem` for simple JS app. | ||
See the [issue 73](https://github.com/webdiscus/html-bundler-webpack-plugin/issues/73). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"description": "IMPORTANT: don't install webpack here because the Webpack instance MUST be one, otherwise appear the error: The 'compilation' argument must be an instance of Compilation.", | ||
"scripts": { | ||
"start": "webpack serve --mode development", | ||
"start:prod": "webpack serve --mode production", | ||
"watch": "webpack watch --mode development", | ||
"build": "webpack --mode=production --progress" | ||
}, | ||
"license": "ISC", | ||
"devDependencies": { | ||
"html-bundler-webpack-plugin": "file:../../.." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Test</title> | ||
</head> | ||
<body> | ||
<h1>Hello World!</h1> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('Hello World! Test: 123'); |
Oops, something went wrong.