Skip to content

Commit 6c77812

Browse files
Aziz Gazanchiyan (ZIZ)Aziz Gazanchiyan (ZIZ)
Aziz Gazanchiyan (ZIZ)
authored and
Aziz Gazanchiyan (ZIZ)
committed
Initial
0 parents  commit 6c77812

File tree

10 files changed

+3044
-0
lines changed

10 files changed

+3044
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/node_modules
2+
/dest

babel.config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env"
5+
]
6+
]
7+
}

index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
color: red;
3+
}

index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
5+
</head>
6+
<body>
7+
<div id="app">Some data here</div>
8+
</body>
9+
</html>

index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import './index.css';
2+
3+
function App() {
4+
5+
const appElement = document.getElementById('app');
6+
7+
appElement.innerHTML = 'Loaded';
8+
}
9+
10+
export default new App();

package-lock.json

Lines changed: 2910 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "html-inline-css-webpack-plugin-broken",
3+
"version": "1.0.0",
4+
"description": "",
5+
"scripts": {
6+
"test": "echo \"Error: no test specified\" && exit 1",
7+
"build": "webpack"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/creage/html-inline-css-webpack-plugin-broken.git"
12+
},
13+
"author": "",
14+
"license": "ISC",
15+
"bugs": {
16+
"url": "https://github.com/creage/html-inline-css-webpack-plugin-broken/issues"
17+
},
18+
"homepage": "https://github.com/creage/html-inline-css-webpack-plugin-broken#readme",
19+
"dependencies": {
20+
"@babel/core": "7.14.0",
21+
"@babel/preset-env": "7.14.1",
22+
"css-loader": "5.2.4",
23+
"babel-loader": "8.2.2",
24+
"copy-webpack-plugin": "8.1.1",
25+
"html-inline-css-webpack-plugin": "1.11.0",
26+
"html-webpack-plugin": "5.3.1",
27+
"webpack": "5.36.2"
28+
},
29+
"devDependencies": {
30+
"webpack-cli": "4.7.0"
31+
}
32+
}

vendor/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
color: blue;
3+
}

vendor/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<head>
5+
<link rel="stylesheet" href="index.css">
6+
</head>
7+
8+
<body>
9+
<div id="app">Some third app here</div>
10+
</body>
11+
12+
</html>

webpack.config.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
const path = require('path'),
2+
3+
HtmlWebpackPlugin = require('html-webpack-plugin'),
4+
HtmlInlineCSSWebpackPlugin = require('html-inline-css-webpack-plugin').default,
5+
6+
CopyWebpackPlugin = require('copy-webpack-plugin');
7+
8+
const ROOT = path.resolve(__dirname, './'),
9+
DEST = path.resolve(__dirname, 'dest');
10+
11+
module.exports = {
12+
mode: 'development',
13+
entry: {
14+
index: ['index']
15+
},
16+
output: {
17+
filename: `[name].js`,
18+
path: DEST,
19+
publicPath: '/'
20+
},
21+
resolve: {
22+
modules: [
23+
ROOT,
24+
path.resolve(ROOT, 'node_modules')
25+
]
26+
},
27+
module: {
28+
rules: [
29+
{
30+
test: /\.js$/,
31+
use: 'babel-loader'
32+
},
33+
{
34+
test: /\.css$/,
35+
use: 'css-loader'
36+
},
37+
]
38+
},
39+
stats: 'minimal',
40+
plugins: [
41+
new HtmlWebpackPlugin({
42+
chunks: ['index'],
43+
filename: 'index.html',
44+
template: path.resolve(ROOT, 'index.html')
45+
}),
46+
new HtmlInlineCSSWebpackPlugin(),
47+
new CopyWebpackPlugin({
48+
patterns: [
49+
{
50+
from: path.resolve(ROOT, 'vendor'),
51+
to: path.resolve(DEST, 'vendor')
52+
}
53+
]
54+
})
55+
]
56+
};

0 commit comments

Comments
 (0)