1
基本テンプレートenter link description hereを使用してng2-bootstrapとwebpackを統合しようとしています。しかし、私はng2-bootstrapの統合を成功させることができないようです。ng2-bootstrap with webpack - Uncaught SyntaxError:予期しないトークンのエクスポート
以下以下
"use strict";
var webpack = require('webpack');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: {
'app': './app/main.ts',
'vendors': './app/vendors.ts',
'polyfills': './app/polyfills.ts'
},
output: {
path: './wwwroot',
filename: '[name].bundle.js',
sourceMapFilename: '[name].bundle.map',
chunkFilename: '[id].chunk.js',
publicPath: '/'
},
devtool: 'source-map',
resolve: {
extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html']
},
module: {
loaders: [
{
test: /\.ts$/,
loaders: ['awesome-typescript-loader', 'angular2-template-loader', 'angular2-router-loader']
},
{
test: /\.(html|css)$/,
loader: 'raw-loader',
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin({ name: ['vendors', 'polyfills'] }),
new CleanWebpackPlugin(
[
'./wwwroot/'
]
),
new HtmlWebpackPlugin({
filename: './index.html',
template: './index.html',
inject: 'body'
})
],
devServer: {
contentBase: ".",
host: "localhost",
port: 9000
}
};
、私はアプリケーションを実行すると
import { DropdownModule } from 'ng2-bootstrap/dropdown';
import { TabsModule } from 'ng2-bootstrap/tabs';
がしかし、エラーが以下の通りです、私の輸入であるいくつかのために
、私のWebパック構成であります奇妙な理由は、ng2-bootstrapコードがブラウザに通じていないように見えるからです。
私はこの問題をすばやく解決できると願っています。了处理、就好这样可以像我你
[そう]英語のみのサイトです。英語で投稿してください。 [詳細はこちら](https://meta.stackoverflow.com/a/262054/1402846)と[ここ](https://blog.stackoverflow.com/2009/07/non-english-question-policy)を参照してください。 。ありがとうございました。 – Pang
**あなたの投稿を**編集し**実際のコードをスクリーンショットではなくテキストとして表示してください。他の人は画像からコピー&ペーストすることはできません。 [詳細はこちら](https://meta.stackoverflow.com/a/285557/1402846)を参照してください。ありがとうございました。 – Pang