IgorMinar / new-world-test

MIT License
14 stars 7 forks source link

Argument type HelloWorldComponent is not assignable to parameter type Type #12

Open ocombe opened 8 years ago

ocombe commented 8 years ago

I've opened the file ts-webpack2/hello_world.ts and Webstorm tells me that bootstrap(HelloWorldComponent); is invalid because "Argument type HelloWorldComponent is not assignable to parameter type Type"

Still the normal compilation works. But then I tried to add the UglifyJS plugin to the webpack config file (to get an idea of the file size once minified):

var webpack = require('webpack');
var path = require('path');

module.exports = {
  cache: false,

  devtool: 'source-map',

  entry: './hello_world.ts',

  output: {
    path: './dist',
    filename: 'bundle.js'
  },

  module: {
    loaders: [
      // .ts files for TypeScript
      { test: /\.ts$/, loader: 'ts-loader' }
    ]
  },

  plugins: [
    // Reference: http://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin
    // Minify all javascript, switch loaders to minimizing mode
    new webpack.optimize.UglifyJsPlugin({
      beautify: false, //prod
      mangle: {
        screw_ie8 : true,
        keep_fnames: true
      },
      compress: {
        screw_ie8: true
      },
      comments: false
    })
  ],

  resolve: {
    extensions: ['', '.ts', '.js']
  }

};

But the compilation doesn't work because of the following error: ERROR in bundle.js from UglifyJs Unexpected token: name (HelloWorldComponent) [./C:/www/new-world-test/ts-webpack2/hello_world.ts:8,0]

This is probably related since both errors are at the same place.

PatrickJS commented 8 years ago

let me include a prod setup and a webpack1 folder

adamdbradley commented 8 years ago

Not sure if it's related, but I'm using Type and getting this typescript error:

Exported variable 'IONIC_DIRECTIVES' has or is using name 'Type' from external module ".../node_modules/@angular/common/src/facade/lang" but cannot be named.