feat: rolled back on webpack

This commit is contained in:
plup 2019-11-14 17:34:37 +01:00
parent 3cb7dbeeb1
commit 643420d6ce
3 changed files with 418 additions and 4214 deletions

4532
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,23 +3,19 @@
"version": "1.0.0",
"license": "MIT",
"scripts": {
"build": "webpack --mode=production",
"serve": "webpack-dev-server --port 3000 --hot --host 0.0.0.0 --mode=development"
"build": "run-p build:*",
"build:css": "node-sass ./src/styles/_index.scss dist/styles.css",
"build:js": "babel 'src/scripts/*.js' -o dist/app.js",
"build:html": "pug src/index.pug -o dist/ --obj config.json"
},
"dependencies": {
"@babel/core": "^7.6.4",
"babel-loader": "^8.0.6",
"css-loader": "^3.2.0",
"file-loader": "^4.2.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.0",
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.0",
"include-media": "^1.4.9",
"node-sass": "^4.13.0",
"normalize.css": "^8.0.1",
"npm-run-all": "^4.1.5",
"pug": "^2.0.4",
"pug-html-loader": "^1.1.5",
"sass-loader": "^8.0.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.9.0"
"pug-cli": "^1.0.0-alpha6"
}
}

View File

@ -1,76 +0,0 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const config = {
entry: {
app: './src/scripts/index.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: "[name].bundle.js",
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.pug'
}),
new MiniCssExtractPlugin({
filename: "style.css"
})
],
module: {
rules: [
{
test: /\.pug$/,
use: [
{ loader: "html-loader" },
{ loader: "pug-html-loader",
options: {
data: {
cdn: "https://cdn.happy-dev.fr",
xmpp: "https://jabber.happy-dev.fr/http-bind/",
authority: "http://127.0.0.1:8000/openid/",
endpoints: {
businessproviders: "http://127.0.0.1:8000/businessproviders/",
circles: "http://127.0.0.1:8000/circles/",
groups: "http://127.0.0.1:8000/groups/",
joboffers: "http://127.0.0.1:8000/job-offers/",
projects: "http://127.0.0.1:8000/projects/",
skills: "http://127.0.0.1:8000/skills/",
users: "http://127.0.0.1:8000/users/"
}
}
}
}
]
},
{
test: /\.js$/,
exclude: /node_modules/,
use: "babel-loader"
},
{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
{ loader: 'css-loader', options: { url: false, sourceMap: true } },
{ loader: 'sass-loader', options: { sourceMap: true } }
]
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
use: 'file-loader'
},
{
test: /\.(eot|ttf|woff|woff2)$/,
loader: 'file-loader',
}
]
}
};
module.exports = (env, argv) => {
if (argv.mode === 'development') {}
if (argv.mode === 'production') {}
return config;
}