diff options
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"], + }, + }, + }, + ], + }, +}; |
