aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack.dev.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-10-30 22:44:55 +0200
committerArmand Philippot <git@armandphilippot.com>2021-10-30 23:09:33 +0200
commit815b190d28cc42e6f3d44d04e1f1ebaea9208cf6 (patch)
tree0d3f0133a39a4a796e698d360dc32f54fb41d8ad /config/webpack.dev.js
parent3a3baddad1c801d77dc398d2c6980f3c14f4a47c (diff)
chore: convert html files to php
Now I can use php to determine current env and load static CSS file if it is prod.
Diffstat (limited to 'config/webpack.dev.js')
-rw-r--r--config/webpack.dev.js91
1 files changed, 0 insertions, 91 deletions
diff --git a/config/webpack.dev.js b/config/webpack.dev.js
deleted file mode 100644
index 4ac420c..0000000
--- a/config/webpack.dev.js
+++ /dev/null
@@ -1,91 +0,0 @@
-const dartSass = require('sass');
-const paths = require('./paths');
-require('dotenv').config();
-
-const protocol = process.env.WEBPACK_PROTOCOL;
-const host = process.env.WEBPACK_HOST;
-const port = process.env.WEBPACK_PORT;
-const siteURL = `${protocol}://${host}/`;
-const isHttps = protocol === 'https';
-const isHMREnabled = process.env.WEBPACK_HOT_RELOAD === 'true';
-const isOpenBoolean = process.env.WEBPACK_OPEN === 'true' || process.env.WEBPACK_OPEN === 'false';
-
-module.exports = {
- mode: 'development',
- module: {
- rules: [
- {
- test: /\.(sa|sc|c)ss$/i,
- use: [
- 'style-loader',
- {
- loader: 'css-loader',
- options: {
- importLoaders: 2,
- sourceMap: true,
- },
- },
- {
- loader: 'postcss-loader',
- options: {
- postcssOptions: {
- plugins: ['autoprefixer'],
- },
- sourceMap: true,
- },
- },
- {
- loader: 'sass-loader',
- options: {
- implementation: dartSass,
- sassOptions: {
- indentWidth: 2,
- outputStyle: 'expanded',
- includePaths: paths.sassPaths,
- },
- sourceMap: true,
- },
- },
- ],
- },
- ],
- },
- devServer: {
- client: {
- overlay: {
- warnings: true,
- errors: true,
- },
- },
- devMiddleware: {
- writeToDisk: true,
- },
- host,
- port,
- hot: isHMREnabled,
- https: !isHttps
- ? false
- : {
- key: process.env.WEBPACK_HTTPS_KEY,
- cert: process.env.WEBPACK_HTTPS_CERT,
- },
- liveReload: true,
- open: isOpenBoolean
- ? process.env.WEBPACK_OPEN
- : {
- app: {
- name: process.env.WEBPACK_OPEN,
- },
- },
- proxy: {
- '/': {
- target: siteURL,
- changeOrigin: true,
- secure: false,
- },
- },
- static: false,
- watchFiles: paths.files,
- },
- devtool: 'inline-source-map',
-};