Use npm build

This commit is contained in:
Alban Bronisz 2021-03-17 12:25:01 +01:00
parent a8c4bde46d
commit b0e2dbbbb4
5 changed files with 1249 additions and 2 deletions

View File

@ -1,6 +1,6 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<script src="test1.js"></script> <script src="bundle.js"></script>
</head> </head>
<body> <body>
</body> </body>

View File

@ -1,3 +1,3 @@
document.write("<link rel=\"stylesheet\" href=\"gh-fork-ribbon.css\">"); require('./gh-fork-ribbon.css');
document.write("<div><a href=\"https://caracals.org\" class=\"cara-logo right-bottom fixed\" title=\"Visiter le site des Caracals\">Visiter le site des Caracals</a></div>"); document.write("<div><a href=\"https://caracals.org\" class=\"cara-logo right-bottom fixed\" title=\"Visiter le site des Caracals\">Visiter le site des Caracals</a></div>");

1213
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

20
package.json Normal file
View File

@ -0,0 +1,20 @@
{
"name": "js-include",
"version": "1.0.0",
"description": "",
"main": "./bundle.js",
"scripts": {
"dev": "webpack --mode='development'",
"build": "webpack -p"
},
"author": "",
"license": "ISC",
"devDependencies": {
"css-loader": "^5.1.3",
"webpack": "^5.26.2",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"style-loader": "^2.0.0"
}
}

14
webpack.config.js Normal file
View File

@ -0,0 +1,14 @@
module.exports = {
entry: './main.js',
output: {
filename: './bundle.js'
},
module: {
rules:[
{
test: /\.css$/,
use: [ 'style-loader', 'css-loader' ]
},
]
}
};