0
Angular2プロジェクトを作成すると、webpackはすべての変更を監視し、再コンパイルを開始します。私はWindowsを再インストールし、ゴミ箱のプロジェクトフォルダをクリアし、奇妙なWebpackの動作を取得します。私がファイル内容を変更するとき - webpack再コンパイルし、ファイルを2回変更したときにwebpackは再コンパイルを開始したくなかった。なぜ???このコマンドによってWebpack - --watchnot working
webpack.config.js
var path = require('path');
const HtmlElementsPlugin = require('./config/html-elements-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
app: './src/main.ts'
},
output: {
path: __dirname,
filename: './dist/app.js'
},
resolve: {
extensions: ['', '.js', '.ts']
},
module: {
loaders: [
{
test: /\.ts/,
loaders: ['ts-loader'],
exclude: /node_modules/
},
{
test: /\.html$/,
loader: "html"
},
{
test: /\.scss$/,
loaders: ["raw", "sass"]
}
]
},
resolve: {
root: path.resolve('src'),
extensions: ['', '.js', '.ts']
},
devServer: {
host: 'localhost',
port: 7777,
contentBase: '.',
historyApiFallback: true
},
watch: true,
cache: false
}
ランのWebPACK:
webpack-dev-server --inline --hot
助けてください。ありがとう。