W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
編譯配置存放于項(xiàng)目根目錄下 config 目錄中,包含三個(gè)文件
const config = {
// 項(xiàng)目名稱
projectName: 'kj',
// 項(xiàng)目創(chuàng)建日期
date: '2018-6-8',
// 設(shè)計(jì)稿尺寸
designWidth: 750,
// 項(xiàng)目源碼目錄
sourceRoot: 'src',
// 項(xiàng)目產(chǎn)出目錄
outputRoot: 'dist',
// babel 編譯配置
babel: {
sourceMap: true,
presets: ['env'],
plugins: ['transform-class-properties', 'transform-decorators-legacy', 'transform-object-rest-spread']
},
// 編譯插件配置
plugins: [],
// 全局變量設(shè)置
defineConstants: {},
// 文件 copy 配置
copy: {
patterns: [
],
options: {
}
},
// 小程序端專用配置
mini: {
postcss: {
autoprefixer: {
enable: true
},
// 小程序端樣式引用本地資源內(nèi)聯(lián)配置
url: {
enable: true,
config: {
limit: 10240
}
}
},
// 替換 JSX 中的屬性名,參考:
// https://github.com/NervJS/taro/issues/2077
jsxAttributeNameReplace: {}
},
// H5 端專用配置
h5: {
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: {
enable: true
}
},
// 自定義 Webpack 配置
webpackChain: {},
devServer: {}
}
};
module.exports = function(merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'));
}
return merge({}, config, require('./prod'));
};
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: