webpack.dev.js 779 B

123456789101112131415161718192021222324
  1. /* global module, process */
  2. const merge = require("webpack-merge");
  3. const prod = require("./webpack.prod.js");
  4. const webpack = require('webpack');
  5. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  6. const ASSET_PATH = process.env.ASSET_PATH || '/dist/'; // eslint-disable-line no-process-env
  7. module.exports = merge(prod, {
  8. output: {
  9. publicPath: ASSET_PATH,
  10. filename: 'converse.js',
  11. },
  12. optimization: {
  13. minimize: false,
  14. },
  15. devtool: 'source-map',
  16. plugins: [
  17. new MiniCssExtractPlugin({filename: '../dist/converse.css'}),
  18. new webpack.DefinePlugin({ // This makes it possible for us to safely use env vars on our code
  19. 'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH)
  20. })
  21. ],
  22. });