You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

const webpack = require('webpack');
const path = require('path');
const HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = {
//项目入口
entry: "./src/index.ts",
//输出设置
output: {
filename: "bundle.js",
path: path.resolve(__dirname, 'dist')
},
//调试工具
devtool: "source-map",
//项目需要解析的文件拓展名称
resolve: {
extensions: [".ts", ".tsx", ".js", "json"]
},
//模块加载器设置
module: {
loaders: [
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" },
{ test: /\.css$/, loader: ['style-loader', 'css-loader']},
{ test: /\.[(jpg)|(png)|(obj)|(json)]$/,loader: "url-loader"},
]
},
//调试服务
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 666
},
//插件
plugins: [
new HtmlWebPackPlugin({title: "cad-view"}),
new webpack.ProvidePlugin({THREE: "three"}),
]
}