gulp构建小程序的方法步骤(2)

const babelOptions = { presets: [ '@babel/preset-typescript', [ '@babel/env' ] ], plugins: [ 'lodash', [ '@babel/plugin-proposal-decorators', { legacy: true } ], 'babel-plugin-add-module-exports', [ '@babel/plugin-transform-runtime', { corejs: false, helpers: true, regenerator: true, useESModules: false } ], [ 'module-resolver', { root: [ '.' ], alias: { '@': './src' } } ], [ 'babel-plugin-copy-npm', { rootDir: 'src', outputDir: 'dist', npmDir: 'npm', format: 'cjs', strict: false, minify: true, loose: true, cache: true } ] ] }; if (process.env.NODE_ENV === 'production') { babelOptions.presets.unshift([ 'minify', { mangle: { exclude: [ 'wx', 'module', 'exports', '__wxConfigx', 'process', 'global' ] }, keepFnName: true } ]); } module.exports = babelOptions;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0d592702a856139c0832819eff0cd4d9.html