diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2021-08-16 16:26:01 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2021-08-16 16:26:01 +0200 |
| commit | bf563861320cf207bb2d788f50b327e4eb37016a (patch) | |
| tree | 7e775216592e1f935fd9a10a6cf59f84c789f7c9 /webpack.config.dev.js | |
| parent | 9ae202820b698796f93b929b3e30cd499de796a1 (diff) | |
showing a graph
Diffstat (limited to 'webpack.config.dev.js')
| -rw-r--r-- | webpack.config.dev.js | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/webpack.config.dev.js b/webpack.config.dev.js new file mode 100644 index 0000000..7a14ebe --- /dev/null +++ b/webpack.config.dev.js @@ -0,0 +1,64 @@ +import dotenv from "dotenv"; +dotenv.config(); + +// const CleanWebpackPlugin = require('clean-webpack-plugin') +import webpack from "webpack"; +import path from "path"; +// const Visualizer = require('webpack-visualizer-plugin') + +const __dirname = path.resolve(); + +// print stack-trace of deprecations in webpack plugins, if something causes this +// process.traceDeprecation = true + +export default { + mode: "development", + entry: { + main: "./src/index.js", + }, + output: { + path: path.resolve(__dirname, "public/assets/js"), + filename: "bundle.js", + }, + devtool: "cheap-module-source-map", + resolve: { + alias: { + // "react": "preact/compat", + // "react-dom/test-utils": "preact/test-utils", + // "react-dom": "preact/compat", + // 'vcat-header': path.resolve(__dirname, '../app/components/common/header.component.js'), + }, + }, + plugins: [ + // new CleanWebpackPlugin(['dist']), + new webpack.DefinePlugin({ + "process.env.NODE_ENV": '"development"', + // 'process.env.S3_HOST': '"' + process.env.S3_HOST + '"', + "process.env.API_HOST": '""', + __REACT_DEVTOOLS_GLOBAL_HOOK__: "({ isDisabled: true })", + }), + // new Visualizer({ + // filename: './statistics.html' + // }) + ], + 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"], + }, + }, + }, + ], + }, +}; |
