File tree Expand file tree Collapse file tree 3 files changed +2686
-10
lines changed Expand file tree Collapse file tree 3 files changed +2686
-10
lines changed Original file line number Diff line number Diff line change @@ -57,20 +57,37 @@ const PLATFORMS = {
5757const platform = PLATFORMS [ process . env . UNI_PLATFORM ]
5858
5959let input = 'src/core/runtime/index.js'
60- const output = {
61- file : `packages/uni-${ process . env . UNI_PLATFORM } /dist/index.js` ,
62- format : 'es' ,
63- sourcemap : process . env . ENABLE_SOURCEMAP === 'true' ? 'inline' : false
64- }
60+ // const output = {
61+ // file: `packages/uni-${process.env.UNI_PLATFORM}/dist/index.js`,
62+ // format: 'es',
63+ // sourcemap: process.env.ENABLE_SOURCEMAP === 'true' ? 'inline' : false
64+ // }
6565
66- if ( process . env . UNI_MP ) {
67- input = 'src/core/runtime/mp/index.js'
68- output . file = `packages/uni-${ process . env . UNI_PLATFORM } /dist/mp.js`
69- }
66+ // if (process.env.UNI_MP) {
67+ // input = 'src/core/runtime/mp/index.js'
68+ // output.file = `packages/uni-${process.env.UNI_PLATFORM}/dist/mp.js`
69+ // }
7070
7171module . exports = {
7272 input,
73- output,
73+ output : process . env . UNI_MP
74+ ? {
75+ file : `packages/uni-${ process . env . UNI_PLATFORM } /dist/mp.js` ,
76+ format : 'es' ,
77+ sourcemap : process . env . ENABLE_SOURCEMAP === 'true' ? 'inline' : false
78+ }
79+ : [
80+ {
81+ file : `packages/uni-${ process . env . UNI_PLATFORM } /dist/index.js` ,
82+ format : 'es' ,
83+ sourcemap : process . env . ENABLE_SOURCEMAP === 'true' ? 'inline' : false
84+ } ,
85+ {
86+ file : `packages/uni-${ process . env . UNI_PLATFORM } /dist/index.common.js` ,
87+ format : 'cjs' ,
88+ sourcemap : process . env . ENABLE_SOURCEMAP === 'true' ? 'inline' : false
89+ }
90+ ] ,
7491 plugins : [
7592 alias ( {
7693 entries : [
Original file line number Diff line number Diff line change @@ -162,6 +162,9 @@ module.exports = {
162162 throw new Error ( 'Vue3 项目暂不支持当前小程序' )
163163 }
164164 }
165+ if ( process . env . UNI_PLATFORM === 'mp-weixin' ) {
166+ return require . resolve ( '@dcloudio/uni-' + process . env . UNI_PLATFORM + '/dist/index.common.js' )
167+ }
165168 return require . resolve ( '@dcloudio/uni-' + process . env . UNI_PLATFORM )
166169 } ,
167170 getPlatformVue ( vueOptions ) {
You can’t perform that action at this time.
0 commit comments