CADViewComponent/config/webpack.common.ts

38 lines
890 B
TypeScript
Raw Normal View History

2018-08-17 21:26:32 +08:00
import * as webpack from 'webpack';
2020-05-07 10:51:27 +08:00
const TS_LOADER = [
{ loader: 'cache-loader', options: { cacheDirectory: "node_modules/.cache_loader" } },
{
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
}
];
2018-08-17 21:26:32 +08:00
const config: webpack.Configuration = {
devtool: "source-map",
//项目需要解析的文件拓展名称
resolve: {
extensions: [".ts", ".tsx", ".js", "json"]
},
//模块加载器设置
module: {
rules: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
2020-05-07 10:51:27 +08:00
use: TS_LOADER,
2018-08-17 21:26:32 +08:00
},
{ test: /\.css$/, loader: ['style-loader', 'css-loader'] },
{ test: /\.[(jpg)|(png)|(obj)|(json)]$/, loader: "url-loader" },
]
},
plugins: [
]
}
export default config;