Skip to content

Commit 4d188f5

Browse files
committed
test: fix test file path
1 parent beb28f7 commit 4d188f5

5 files changed

Lines changed: 92 additions & 2 deletions

File tree

test/cases/preprocessor-handlebars-helper-layouts/src/views/partials/context.hbs

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"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.",
3+
"scripts": {
4+
"start": "webpack serve --mode development",
5+
"watch": "webpack watch --mode development",
6+
"build": "webpack --mode=production --progress"
7+
},
8+
"devDependencies": {
9+
"html-bundler-webpack-plugin": "file:../../..",
10+
"prismjs": "^1.29.0",
11+
"swiper": "^11.0.7"
12+
}
13+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Home</title>
5+
<link href="./style.scss" rel="stylesheet" />
6+
</head>
7+
<body>
8+
<h1>Home</h1>
9+
</body>
10+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// TEST: import css files form various node modules
2+
3+
//@use 'prismjs/themes/prism-tomorrow.min'; // OK
4+
5+
//@use 'swiper/swiper-bundle'; // <= NOT works, because it is BUG in node_modules/swiper/package.json
6+
@use 'swiper/css/bundle'; // <= works from `exports` field in package.json
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
const path = require('path');
2+
const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');
3+
4+
module.exports = {
5+
mode: 'production',
6+
//stats: 'normal',
7+
stats: 'errors-warnings',
8+
9+
output: {
10+
path: path.join(__dirname, 'dist/'),
11+
clean: true,
12+
},
13+
14+
plugins: [
15+
new HtmlBundlerPlugin({
16+
entry: {
17+
index: './src/home.html',
18+
},
19+
20+
js: {
21+
filename: 'js/[name].[contenthash:8].js',
22+
//filename: 'js/[name].js',
23+
},
24+
25+
css: {
26+
filename: 'css/[name].[contenthash:8].css',
27+
},
28+
29+
//verbose: true,
30+
hotUpdate: false, // test to disable auto-injection of hot-update.js files
31+
}),
32+
],
33+
34+
module: {
35+
rules: [
36+
{
37+
test: /\.(s?css)/,
38+
use: ['css-loader', 'sass-loader'],
39+
},
40+
41+
{
42+
test: /\.(png|jpe?g|ico|svg)$/,
43+
type: 'asset/resource',
44+
generator: {
45+
filename: 'img/[name].[hash:8][ext]',
46+
},
47+
},
48+
],
49+
},
50+
51+
devServer: {
52+
//hot: false,
53+
static: {
54+
directory: path.join(__dirname, 'dist'),
55+
},
56+
watchFiles: {
57+
paths: ['src/**/*.*'],
58+
options: {
59+
usePolling: true,
60+
},
61+
},
62+
},
63+
};

0 commit comments

Comments
 (0)