CADViewComponent/config/webpack.common.ts
2022-02-16 13:48:57 +08:00

38 lines
890 B
TypeScript

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