Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Compilation dose not work in watch mode #72

Closed
ytkj opened this issue Nov 12, 2015 · 2 comments · Fixed by #73
Closed

Compilation dose not work in watch mode #72

ytkj opened this issue Nov 12, 2015 · 2 comments · Fixed by #73

Comments

@ytkj
Copy link

ytkj commented Nov 12, 2015

My configuration is

module.exports = {
  watch: true,
  resolve: {
    extensions: ['', '.ts']
  },
  module: {
    loaders: [{
      test: /\.ts$/,
      exclude: /node_modules/,
      loader: 'awesome-typescript-loader',
    }]
  }
};

and my gulpfile is

var gulp = require('gulp');
var path = require('path');
var webpack = require('webpack-stream');

var config = require('./webpack.config');

var sources = [
  path.join(__dirname, '/src/app1/app1.ts')
];
var dest = path.join(__dirname, '/dist');

gulp.task('build', function(callback) {
  return gulp.src(sources)
    .pipe(webpack(config))
    .pipe(gulp.dest(dest));
});

gulp.task('default', ['build']);

compilation only works in the first time execute gulp command.

 c:\work>gulp
[23:14:06] Using gulpfile c:\work\gulpfile.js
[23:14:06] Starting 'build'...
[23:14:09] Version: webpack 1.12.4
                  Asset     Size  Chunks             Chunk Names
ba333baa88334adf4b2d.js  1.69 kB       0  [emitted]  main
[23:14:09] webpack is watching for changes
[23:14:17] Version: webpack 1.12.4
[23:14:17] webpack is watching for changes
  • node v5.0.0
  • gulp v3.9.0
  • webpack v1.12.4
  • webpack-stream v2.1.1
  • awesome-typescript-loader v0.14.1
@davidmiani
Copy link
Contributor

I have attempted a fix for this. Can you try using "davidmiani/awesome-typescript-loader#withdist" for the awesome-typescript-loader version in the packages.json file. Then run rm -r node_modules/awesome-typescript-loader and npm install. If that works I'll make a pull request for the change needed to fix it.

@ytkj
Copy link
Author

ytkj commented Nov 12, 2015

@davidmiani
works fine! thx!

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

Successfully merging a pull request may close this issue.

2 participants