Преглед на файлове

Fix webpack issue where copied font files get removed

JC Brand преди 5 години
родител
ревизия
c2fe2aabff
променени са 2 файла, в които са добавени 3 реда и са изтрити 7 реда
  1. 0 6
      webpack.dev.js
  2. 3 1
      webpack.prod.js

+ 0 - 6
webpack.dev.js

@@ -4,11 +4,8 @@ const prod = require("./webpack.prod.js");
 const webpack = require('webpack');
 const MiniCssExtractPlugin = require('mini-css-extract-plugin');
 
-const ASSET_PATH = process.env.ASSET_PATH || '/dist/'; // eslint-disable-line no-process-env
-
 module.exports = merge(prod, {
     output: {
-        publicPath: ASSET_PATH,
         filename: 'converse.js',
     },
     optimization: {
@@ -17,8 +14,5 @@ module.exports = merge(prod, {
     devtool: 'source-map',
     plugins: [
         new MiniCssExtractPlugin({filename: '../dist/converse.css'}),
-        new webpack.DefinePlugin({ // This makes it possible for us to safely use env vars on our code
-            'process.env.ASSET_PATH': JSON.stringify(ASSET_PATH)
-        })
     ],
 });

+ 3 - 1
webpack.prod.js

@@ -14,8 +14,10 @@ module.exports = merge(common, {
         filename: 'converse.min.js',
     },
     plugins: [
+        new CleanWebpackPlugin({
+            cleanStaleWebpackAssets: false // resolves conflict with CopyWebpackPlugin
+        }),
         new MiniCssExtractPlugin({filename: '../dist/converse.min.css'}),
-        new CleanWebpackPlugin(),
         new CopyWebpackPlugin([
             {from: 'images/favicon.ico'},
             {from: 'images/custom_emojis', to: 'custom_emojis'},