summaryrefslogtreecommitdiff
path: root/webpack.config.site.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
committerJules Laplace <julescarbon@gmail.com>2020-07-11 00:50:00 +0200
commit91e8fdb99e321496c54288fe5a3db6397c768c10 (patch)
tree2bb82323466c7895eb705138e561278b02ce8ca2 /webpack.config.site.js
parent2001ddd7e2a8926ec97fdd4d5c73b2d4e5b293de (diff)
building basic site. need to include cursors, etc
Diffstat (limited to 'webpack.config.site.js')
-rw-r--r--webpack.config.site.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/webpack.config.site.js b/webpack.config.site.js
new file mode 100644
index 0000000..8a62c75
--- /dev/null
+++ b/webpack.config.site.js
@@ -0,0 +1,54 @@
+require('dotenv').config()
+
+const webpack = require('webpack')
+const path = require('path')
+
+// print stack-trace of deprecations in webpack plugins, if something causes this
+// process.traceDeprecation = true
+
+module.exports = {
+ mode: "development",
+ entry: {
+ main: './frontend/site/index.js'
+ },
+ output: {
+ path: path.resolve(__dirname, 'static/js/dist'),
+ filename: 'bundle.js'
+ },
+ devtool: 'cheap-module-eval-source-map',
+ resolve: {
+ alias: {
+ // "react": "preact/compat",
+ // "react-dom/test-utils": "preact/test-utils",
+ // "react-dom": "preact/compat",
+ }
+ },
+ plugins: [
+ new webpack.DefinePlugin({
+ 'process.env.NODE_ENV': '"development"',
+ '__REACT_DEVTOOLS_GLOBAL_HOOK__': '({ isDisabled: true })'
+ }),
+ ],
+ module: {
+ rules: [
+ {
+ test: /\.css$/,
+ use: ['style-loader', 'css-loader']
+ },
+ {
+ test: /\.js$/,
+ // include: path.resolve(__dirname, 'client'),
+ exclude: /(node_modules|bower_components|build)/,
+ use: {
+ loader: 'babel-loader',
+ options: {
+ presets: ['@babel/preset-env'],
+ plugins: [
+ "@babel/plugin-transform-runtime",
+ ],
+ }
+ }
+ }
+ ]
+ }
+}