加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.rules.js 1.57 KB
一键复制 编辑 原始数据 按行查看 历史
Tobias Diez 提交于 2020-08-08 15:49 . Revision based on feedback
module.exports = [
// Add support for native node modules
{
test: /\.node$/,
use: 'node-loader'
},
{
test: /\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: '@marshallofsound/webpack-asset-relocator-loader',
options: {
outputAssetBase: 'native_modules'
}
}
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'@teamsupercell/typings-for-css-modules-loader',
'css-loader'
]
},
{
// Handle picture files: just copy them
test: /\.(png|svg|jpg|gif)$/,
use: {
loader: 'file-loader',
options: {
// Do not wrap in js module (important for handlebars)
esModule: false
}
}
},
{
// Handle font files: just copy them
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: {
loader: 'file-loader',
options: {
// Do not wrap in js module
esModule: false
}
}
},
{
// Handle audio files: just copy them
test: /\.(ogg)$/,
use: {
loader: 'file-loader',
options: {
// Do not wrap in js module
esModule: false
}
}
},
{
// Handle files for citeproc: copy them, and import them as string
test: /\.(xml|csl)$/,
use: {
loader: 'raw-loader',
options: {
// Do not wrap in js module
esModule: false
}
}
},
{
test: /(.ts|.tsx)$/,
exclude: /(node_modules|\.webpack)/,
use: {
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
}
]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化