在开发过程中停止生成这么多热插拔文件

时间:2017-05-09 17:59:23

标签: webpack

我经常运行webpack -w,然后使用Webstorm进行开发。

然而,在开发过程中,它总是给我这么多 hot.js

我怎样才能让webpack清除它并保持文件夹清洁?非常感谢?

热插拔js

0.384434ac9a6438578f33.hot-update.js.map  0.ba01e4e2ca2fa9c91a45.hot-update.js.map
0.8ccaef43c781a128fcc0.hot-update.js.map  0.c585de906a5263f75325.hot-update.js.map
0.92cc654141a7ebb94daa.hot-update.js.map  bundle.js.map
0.9585c8f281065064131a.hot-update.js.map  componentStructureGenerator-bundle.js.map
0.a44a5d5f085d8b740d44.hot-update.js.map  uiBuilder-bundle.js.map
0.b2218510293da05d0020.hot-update.js.map  webpack.config.js.map

Webpack config

var webpack = require('webpack');
var CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {

    entry: {
        uiBuilder: "./src/modules/ui_builder/Index.tsx",
        componentStructureGenerator: "./src/modules/component_structure_generator/Index.ts",
    },
    output: {
        path: "./dist",
        filename: "[name]-bundle.js"
    },

    devtool: 'source-map',
    resolve: {
        extensions: ['', '.ts', '.tsx', '.js', '.json']
    },

    module: {
        preLoaders: [
            {test: /\.json$/, exclude: /node_modules/, loader: 'json'},
        ],
        loaders: [
            {test: /\.tsx?$/, loader: 'ts-loader'},
            {test: /\.scss$/, loaders: ['style', 'css', 'sass']},
            {
                test: /\.css$/,
                loader: 'style!css!'
            },
            {test: /\.png$/, loader: 'url-loader?mimetype=image/png'},
            {test: /\.json$/, loader: 'json'}
        ],
        preLoaders: [
            {test: /\.js$/, loader: 'source-map-loader'}
        ]
    },
    devServer: {
        stats: 'errors-only',
        hot: true
    }
    target: 'node'
};

0 个答案:

没有答案