Skip to content

Compilation triggered without changes #1122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 3 tasks
RDeluxe opened this issue Sep 28, 2017 · 1 comment
Closed
1 of 3 tasks

Compilation triggered without changes #1122

RDeluxe opened this issue Sep 28, 2017 · 1 comment
Labels

Comments

@RDeluxe
Copy link

RDeluxe commented Sep 28, 2017

  • Operating System: Windows 10
  • Node Version: 8.1.4
  • NPM Version: 5.3.0 (using yarn 0.27.5)
  • webpack Version: 3.5.5
  • webpack-dev-server Version: 2.7.1
  • IDE : VSCode
  • This is a bug
  • This is a feature request
  • This is a modification request

Code

webpack.common.js :

var webpack = require("webpack");
var HtmlWebpackPlugin = require("html-webpack-plugin");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var helpers = require("./helpers");
var path = require('path');
var CopyWebpackPlugin = require('copy-webpack-plugin');
const { TsConfigPathsPlugin } = require('awesome-typescript-loader');

module.exports = {
  entry: {
    "polyfills": "./polyfills.ts",
    "app": "./src/main.ts"
  },

  resolve: {
    extensions: [
      ".js", ".ts"
    ],
    alias: {
      styles: path.resolve(__dirname, '../src/style/styles.scss'),
      vendors: path.resolve(__dirname, '../src/vendors/')
    },
    plugins: [
      new TsConfigPathsPlugin({
        configFileName: path.resolve(__dirname, '../tsconfig.json'),
        compiler: "typescript"
      }
      )
    ]
  },

  module: {
    rules: [
      {
        test: /\.ts$/,
        loaders: ['awesome-typescript-loader', 'angular2-template-loader']
      },
      {
        test: /\.html$/,
        use: "html-loader"
      },
      {
        test: /\.pug$/,
        use: ["raw-loader", "pug-html-loader"]
      },
      {
        test: /\.(css|scss|sass)$/,
        include: path.resolve(__dirname, '../src/style'),
        include: path.resolve(__dirname, '../src/app'),
        loaders: ['to-string-loader'].concat(ExtractTextPlugin.extract({
          fallback: "style-loader",
          use: [
            {
              loader: 'css-loader',
              options: {
                alias: {
                  assets: path.resolve(__dirname, '../src/assets')
                },
                sourceMap: true
              }
            },
            {
              loader: 'sass-loader',
              options: {
                sourceMap: true
              }
            }
          ]
        }))
      },
      {
        test: /\.(png|jpe?g|gif|svg|woff|woff2|otf|ttf|eot|ico)$/,
        use: "file-loader?name=assets/[name].[hash].[ext]"
      }
    ]
  },

  plugins: [
    new webpack.optimize.CommonsChunkPlugin({
      name: ["app", "vendor", "polyfills"]
    }),

    new CopyWebpackPlugin([
      { from: 'src/assets/i18n/', to: 'assets/i18n' }
    ]),

    new HtmlWebpackPlugin({
      template: "index.html"
    }),

    // Workaround for Angular-SystemJS-Webpack(2) WARNINGS
    new webpack.ContextReplacementPlugin(
      /angular(\\|\/)core(\\|\/)@angular/,
      helpers.root('.'),
      {
        // your Angular Async Route paths relative to this root directory
      }
    )
  ]
};

webpack.dev.js

var webpackMerge = require("webpack-merge");
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var commonConfig = require("./webpack.common.js");
var helpers = require("./helpers");

module.exports = webpackMerge(commonConfig, {
  devtool: "cheap-module-eval-source-map",

  output: {
    path: helpers.root("dist"),
    filename: "[name].js",
    chunkFilename: "[id].chunk.js"
  },

  plugins: [
    new ExtractTextPlugin("[name].css")
  ],

  devServer: {
    watchOptions: {
      aggregateTimeout: 500,
      ignored: "../node_modules/**"
    }
  }
});

Expected Behavior

Compilation triggers only when I modify and save a file.

Actual Behavior

Compilation triggers randomly without any action on my side (when I'm checking my DOM in my browser, etc.)

For Bugs; How can we reproduce the behavior?

I have no idea.

@shellscape
Copy link
Contributor

@RDeluxe thanks for checking in. this isn't something we see running in tests or examples, but we've seen similar questions pop up before that were resolved by way of correcting config, identifying an errant loader/plugins, correcting an environment issue, or a combination of the typical culprits.

unfortunately this issue falls into the category of a support question, which we ask folks to head to Stack Overflow and Gitter first for help on. closing as question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants