尝试在基于Web包的捆绑包中包含typescript

尝试在基于Web包的捆绑包中包含typescript,typescript,webpack,Typescript,Webpack,即使我设置了加载程序:“ts”我也看到了这个错误: 50% 4/6 build modulesModuleParseError: Module parse failed: /home/rob/git/repo/src/app/container.entry.ts Unexpected token (16:70) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (

即使我设置了
加载程序:“ts”
我也看到了这个错误:

 50% 4/6 build modulesModuleParseError: Module parse failed: /home/rob/git/repo/src/app/container.entry.ts Unexpected token (16:70)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (16:70)
webpack.common.js

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

module.exports = {
  entry: {
    app: [
      './src/main.ts'
    ],
    container: [
            './src/app/container.entry.ts'
    ],
    containerPrereqs: [
            'angular'
    ]
  },

  resolve: {
    root: [ path.join(__dirname, 'node_modules')],
    extensions: ['', '.ts', '.js']
  },

  module: {
    rules: [{
        test: /\.ts$/,
        loader: 'ts'
      },
      {
        test: /\.html$/,
        loader: 'html-loader'
      },
      {
        test: /\.css$/,
        loaders: ['to-string-loader', 'css-loader']
      }
    ]
  }
};
package.json中的代码片段:

"dependencies": {
    "angular": "1.6.1",
    "ts-loader": "^0.8.1",
    "typescript": "2.3.3",
    "css-loader": "^0.28.4",
    "html-loader": "^0.4.3",
    "to-string-loader": "^1.1.5",
    "webpack": "^1.12.14"
},
根据您需要使用的

{
    test: /\.ts$/,
    loader: 'ts-loader'
},
您似乎缺少“-loader”部分

去过那里,做过那件事:)