加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
webpack.rules.js 1.15 KB
一键复制 编辑 原始数据 按行查看 历史
Michael Truell 提交于 2023-03-23 01:32 . hello world!
module.exports = [
// Add support for native node modules
{
// We're specifying native_modules in the test because the asset relocator loader generates a
// "fake" .node file which is really a cjs file.
test: /native_modules[/\\].+\.node$/,
use: 'node-loader',
},
{
test: /[/\\]node_modules[/\\].+\.(m?js|node)$/,
parser: { amd: false },
use: {
loader: '@vercel/webpack-asset-relocator-loader',
options: {
outputAssetBase: 'native_modules',
},
},
},
{
test: /\.jsx?$/,
use: {
loader: 'babel-loader',
options: {
exclude: /node_modules/,
presets: ['@babel/preset-react'],
},
},
},
// Put your webpack loader rules in this array. This is where you would put
// your ts-loader configuration for instance:
// Typescript Example:
{
test: /\.tsx?$/,
exclude: /(node_modules|.webpack)/,
loader: 'ts-loader',
},
{
test: /\.(png|svg|jpg|jpeg|gif|ttf)$/i,
type: 'asset/resource',
},
]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化