Webpack强制通过CLI webpack工具重新渲染(重新编译,重新编译)

Somethimes的webpack不接受我对jsx和scss文件的更改 ,因此它不会编译更新的main.scssmain.js (有时)。

webpack运行在安装在高山linux轻量级环境中的docker容器中。

我想SSH入docker集装箱,并直接通过webpack命令行工具强行重新编译更改。

可能有一些像$ webpack –force-complie或者–force-watch之类的手动方式来手动运行main.scss和main.js的重build过程

有没有办法做到这一点?

这里是我的webpack.config.js文件:

const ExtractTextPlugin = require("extract-text-webpack-plugin"); const webpack = require("webpack"); const autoprefixer = require("autoprefixer"); if (process.env.NODE_ENV === "development") { require("dotenv").config(); } module.exports = { entry: "./assets/shared/main.jsx", output: { path: "public", publicPath: "/", filename: "main.js" }, module: { preLoaders: [ { test: /\.jsx?$/, exclude: /(node_modules)/, loader: "eslint-loader" } ], loaders: [ { test: /\.jsx?$/, exclude: /(node_modules)/, loader: "babel-loader", query: { presets: ["react", "es2015", "stage-0"] } }, { test: /\.scss$/, exclude: /(node_modules)/, loader: ExtractTextPlugin.extract( "style-loader", "css-loader?sourceMap!postcss-loader!sass-loader" ) }, { test: /\.(png|jpg)$/, // inline base64 URLs for <=4k images, direct URLs for the rest loader: "url-loader?limit=4096" } ] }, devtool: "source-map", stats: { children: false }, postcss: function () { return [autoprefixer]; }, eslint: { quiet: true }, plugins: [ new ExtractTextPlugin("styles.css"), new webpack.EnvironmentPlugin([ "NODE_ENV", // This is used to run React in "production" mode "API_URL" ]) ] };