Skip to content

Commit 7cb5f64

Browse files
committed
test: add the manual test for the issue #74
1 parent c0ad790 commit 7cb5f64

10 files changed

Lines changed: 113 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Manual test
2+
3+
The issue [Inclining imported css doesn't work in watch mode if a leaf component content is changed](https://github.com/webdiscus/html-bundler-webpack-plugin/issues/74).
4+
5+
TODO: describe steps to reproduce the issue
6+
7+
1. start development: `npm start`
8+
2. change `src/home.html` => ok
9+
3. change `src/style.css` => ok
10+
4. change `src/main.js` => ok
11+
5. change `src/component-a/style.css` => ok
12+
6. change `src/component-a/index.js` => ok
13+
7. change `src/component-b/style.css` => ok
14+
8. change `src/component-b/index.js` => ok
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"scripts": {
3+
"start": "webpack serve --mode development",
4+
"watch": "webpack watch --mode development",
5+
"build": "webpack --mode=production --progress"
6+
},
7+
"devDependencies": {
8+
"html-bundler-webpack-plugin": "file:../../.."
9+
}
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// local style
2+
import './style.css';
3+
4+
// node module component importing an own css file
5+
import '@test/import-css';
6+
7+
console.log('>> component a');
8+
9+
export default `<div class="component-a">Component A</div>`;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.component-a {
2+
color: red;
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import './style.css';
2+
3+
console.log('>> component b');
4+
5+
export default `<div class="component-b">Component B</div>`;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.component-b {
2+
color: blue;
3+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Home</title>
5+
</head>
6+
<body>
7+
<h1>Hello World!</h1>
8+
<div id="root"></div>
9+
<div class="toolbar">Component Toolbar from node_modules</div>
10+
<script src="./main.js"></script>
11+
</body>
12+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import './style.css';
2+
3+
import componentA from './components/a';
4+
import componentB from './components/b';
5+
6+
document.getElementById('root').innerHTML = componentA + componentB;
7+
8+
console.log('>> main');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1 {
2+
color: seagreen;
3+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const path = require('path');
2+
const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');
3+
4+
module.exports = {
5+
mode: 'production',
6+
stats: 'minimal',
7+
8+
output: {
9+
path: path.join(__dirname, 'dist/'),
10+
},
11+
12+
plugins: [
13+
new HtmlBundlerPlugin({
14+
entry: {
15+
index: './src/home.html',
16+
},
17+
js: {
18+
inline: true,
19+
},
20+
css: {
21+
inline: true,
22+
},
23+
}),
24+
],
25+
26+
module: {
27+
rules: [
28+
{
29+
test: /\.(css)$/,
30+
use: ['css-loader'],
31+
},
32+
],
33+
},
34+
35+
devServer: {
36+
static: {
37+
directory: path.join(__dirname, 'dist'),
38+
},
39+
watchFiles: {
40+
paths: ['src/**/*.*'],
41+
options: {
42+
usePolling: true,
43+
},
44+
},
45+
},
46+
};

0 commit comments

Comments
 (0)