/
githubmirror
/
taro
Обзор
Документация
Войти
/
githubmirror
/
taro
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/mini-split-chunks-plugin/config/index.js
86 строк
2 KB
liuzejia
lint: 修改node模块的引入
24 июн 2024, 16:25
24 июн 2024, 16:25
1965b18
Код
Авторство
О чём код?
import path from 'node:path' const config = { // 使用 Webpack5 进行编译 compiler: 'webpack5', projectName: 'MiniSplitChunksPlugin', date: '2022-2-8', designWidth: 750, deviceRatio: { 640: 2.34 / 2, 750: 1, 828: 1.81 / 2 }, sourceRoot: 'src', outputRoot: 'dist', plugins: [], defineConstants: { }, copy: { patterns: [ ], options: { } }, framework: 'react', mini: { optimizeMainPackage: { enable: true, // exclude: [(module) => module.resource?.indexOf('miniprogram-sm-crypto') >= 0], fileType: { templ: '.wxml', style: '.wxss', config: '.json', script: '.js', xs: '.wxs' } }, postcss: { pxtransform: { enable: true, config: { } }, url: { enable: true, config: { limit: 1024 // 设定转换尺寸上限 } }, cssModules: { enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]' } } } }, h5: { publicPath: '/', staticDirectory: 'static', esnextModules: ['taro-ui'], postcss: { autoprefixer: { enable: true, config: { } }, cssModules: { enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true config: { namingPattern: 'module', // 转换模式,取值为 global/module generateScopedName: '[name]__[local]___[hash:base64:5]' } } } } } module.exports = function (merge) { if (process.env.NODE_ENV === 'development') { return merge({}, config, require('./dev')) } return merge({}, config, require('./prod')) }