使用sbt以角度2和webpack运行Play框架

时间:2017-01-20 16:27:00

标签: scala angular playframework webpack sbt

我是上述所有人的新手,我知道可以使用sbt和Play运行角度2。我正在使用此github project作为指南并尝试合并webpack。我只使用sbt~shun因此我不想使用激活器来运行项目。我也在使用这个sbt-play-webpack plugin。我收到以下错误:

[info]                 Asset     Size  Chunks             Chunk Names
[info] javascripts/bundle.js  6.17 kB       0  [emitted]  main
[info]              main.map  2.56 kB       0  [emitted]  main
[info]     + 1 hidden modules
[info]
[info] ERROR in ./app/assets/app/main.ts
[info] Module build failed: Error: Cannot find module 'source-map-support'

我不确定我是否遗漏了任何配置文件。到目前为止,我有package.json,webpack.config.js,tsconfig.json,plugins.sbt和build.sbt。我错过了什么吗?

webpack.config.js文件:

const webpack = require('webpack');
const path = require('path');
const WebpackCleanupPlugin = require('webpack-cleanup-plugin');
const webpackMerge = require('webpack-merge');



module.exports = {
//context: path.join(__dirname, '/assets'),
entry: {//changed this by RADHA
    'main': './app/assets/app/main.ts'
},
output: {
    path: path.resolve(__dirname, '/public/bundles'),
    publicPath: '/assets/bundles/',
    filename: 'javascripts/bundle.js',
    sourceMapFilename: '[name].map'
},
plugins: [
    new WebpackCleanupPlugin(),
],

devtool: 'source-map',


resolve: {

    extensions: ['.ts', '.js' ],
    modules: [ path.resolve(__dirname, process.env.NODE_PATH) ]
},

module: {
    loaders: [
      // .ts files for TypeScript
      {
        test: /\.ts$/,
        loaders: [
          'awesome-typescript-loader',
          'angular2-template-loader',
          'angular2-router-loader'
        ]
      }
    ]
},
node: {
    global: true,
    crypto: 'empty',
    __dirname: true,
    __filename: true,
    process: true,
    Buffer: false,
    clearImmediate: false,
    setImmediate: false
}


};

0 个答案:

没有答案