1 Star 0 Fork 0

xingcongcong123/snabbdom-source-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
tests.webpack.config.cjs 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
xingcongcong 提交于 2021-10-08 13:46 . init
const path = require('path')
const isPathInside = require('is-path-inside')
const globby = require('globby')
const outputPath = path.resolve(__dirname, 'build/test')
const makeTestsWebpackConfig = async () => ({
mode: 'development',
entry: Object.fromEntries(
(await globby(path.resolve(outputPath, '**/*.js')))
.map((item) => [path.relative(outputPath, item), item])
),
output: {
path: path.resolve(__dirname, 'test-bundles'),
filename: ({ chunk }) => chunk.name
},
module: {
rules: [
{
exclude: (input) => isPathInside(input, path.resolve(__dirname, 'node_modules')),
test: /\.m?js$/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
useBuiltIns: 'usage',
corejs: 3,
}
]
]
}
}
}
]
},
resolve: {
alias: {
'latest-snabbdom-release/init': 'latest-snabbdom-release/build/package/init'
}
}
})
module.exports = makeTestsWebpackConfig
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xingcongcong123/snabbdom-source-code.git
[email protected]:xingcongcong123/snabbdom-source-code.git
xingcongcong123
snabbdom-source-code
snabbdom-source-code
master

搜索帮助