Skip to content

Commit

Permalink
fix(taro): 文件打包错误
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed May 4, 2018
1 parent a90f579 commit e739236
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"npm-run-all": "^4.1.2",
"rimraf": "^2.6.2",
"rollup": "^0.57.1",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-babel": "^4.0.0-beta.2",
"rollup-plugin-buble": "^0.19.2",
"rollup-plugin-commonjs": "^9.1.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/taro-h5/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { join } = require('path')
const resolve = require('rollup-plugin-node-resolve')
const babel = require('rollup-plugin-babel')
const common = require('rollup-plugin-commonjs')
const alias = require('rollup-plugin-alias')
const cwd = __dirname

const baseConfig = {
Expand All @@ -22,6 +24,9 @@ const baseConfig = {
}
],
plugins: [
alias({
'@tarojs/taro': join(cwd, '../taro/src/index')
}),
resolve({
preferBuiltins: false
}),
Expand All @@ -39,7 +44,8 @@ const baseConfig = {
'pragma': 'Nerv.createElement'
}]
]
})
}),
common()
]
}
const esmConfig = Object.assign({}, baseConfig, {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-h5/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
import { getEnv, ENV_TYPE, internal_safe_get, internal_dynamic_recursive } from '@tarojs/taro/index.esm.js'
import { getEnv, ENV_TYPE, internal_safe_get, internal_dynamic_recursive } from '@tarojs/taro'

import initNativeApi from './native-api'

Expand Down
8 changes: 7 additions & 1 deletion packages/taro-weapp/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const { join } = require('path')
const resolve = require('rollup-plugin-node-resolve')
const babel = require('rollup-plugin-babel')
const common = require('rollup-plugin-commonjs')
const alias = require('rollup-plugin-alias')
const cwd = __dirname

const baseConfig = {
Expand All @@ -22,6 +24,9 @@ const baseConfig = {
}
],
plugins: [
alias({
'@tarojs/taro': join(cwd, '../taro/src/index')
}),
resolve({
preferBuiltins: false
}),
Expand All @@ -39,7 +44,8 @@ const baseConfig = {
'pragma': 'Nerv.createElement'
}]
]
})
}),
common()
]
}
const esmConfig = Object.assign({}, baseConfig, {
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-weapp/src/create-page.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { internal_safe_get as safeGet } from '@tarojs/taro/index.esm.js'
import { internal_safe_get as safeGet } from '@tarojs/taro'

import { isEmptyObject, getPrototypeChain } from './util'

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-weapp/src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable camelcase */
import { getEnv, ENV_TYPE, internal_safe_get, internal_dynamic_recursive } from '@tarojs/taro/index.esm.js'
import { getEnv, ENV_TYPE, internal_safe_get, internal_dynamic_recursive } from '@tarojs/taro'

import Component from './component'
import createApp from './create-app'
Expand Down
6 changes: 6 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7485,6 +7485,12 @@ ripemd160@^2.0.0, ripemd160@^2.0.1:
hash-base "^2.0.0"
inherits "^2.0.1"

rollup-plugin-alias@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/rollup-plugin-alias/-/rollup-plugin-alias-1.4.0.tgz#120cba7c46621c03138f0ca6fd5dd2ade9872db9"
dependencies:
slash "^1.0.0"

rollup-plugin-babel@^4.0.0-beta.2:
version "4.0.0-beta.4"
resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.0.0-beta.4.tgz#d869646885d6ad73dd10791a261fb92674a80410"
Expand Down

0 comments on commit e739236

Please sign in to comment.