adarts
Version:
!!! This module is not prepare to use !!! adarts is a double array tries lib, support a/c automaton when search.
52 lines (47 loc) • 1.58 kB
JavaScript
// `CheckerPlugin` is optional. Use it if you want async error reporting.
// We need this plugin to detect a `--watch` mode. It may be removed later
// after https://github.com/webpack/webpack/issues/3460 will be resolved.
const webpack = require('webpack'),
path = require('path'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
{
CheckerPlugin
} = require('awesome-typescript-loader');
module.exports = {
// 入口文件
entry: "./src/main.ts",
// 输出目录和文件
output: {
path: path.join(__dirname, "dist"),
filename: "bundle.js"
},
// Currently we need to add '.ts' to the resolve.extensions array.
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
// Source maps support ('inline-source-map' also works)
devtool: 'cheap-inline-source-map',
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 9090
},
// Add the loader for .ts files.
module: {
rules: [{
test: /\.ts?$/,
use: 'awesome-typescript-loader'
}]
},
plugins: [
new CheckerPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, "/res/index.tpl.html"),
}),
new webpack.BannerPlugin('Author: Andares Merigold'),
new webpack.optimize.OccurrenceOrderPlugin(),
// will throw error: Unexpected token: name (Adarts)
// new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.ModuleConcatenationPlugin()
]
};