-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mobx-common mobx-h5): 增加编译代码 fix #2017
- Loading branch information
Showing
8 changed files
with
102 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module.exports = require('./dist/index.js') | ||
module.exports.default = module.exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,2 @@ | ||
import { Component } from '@tarojs/taro-h5' | ||
import { createElement } from 'nervjs' | ||
import { inject as originInject } from '@tarojs/mobx-common' | ||
|
||
export function inject () { | ||
return originInject(...arguments, { Component, createElement }) | ||
} | ||
|
||
export { observer } from '@tarojs/mobx-common' | ||
|
||
export { default as Provider } from './Provider' | ||
module.exports = require('./dist/index.js') | ||
module.exports.default = module.exports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import babel from 'rollup-plugin-babel' | ||
import commonjs from 'rollup-plugin-commonjs' | ||
import resolve from 'rollup-plugin-node-resolve' | ||
|
||
export default { | ||
input: 'src/index.js', | ||
external: ['nervjs', '@tarojs/taro-h5', 'mobx'], | ||
output: [{ | ||
file: 'dist/index.js', | ||
format: 'cjs', | ||
sourcemap: false, | ||
exports: 'named' | ||
}, { | ||
file: 'dist/index.esm.js', | ||
format: 'esm', | ||
sourcemap: false, | ||
exports: 'named' | ||
}], | ||
plugins: [ | ||
resolve({ | ||
preferBuiltins: false | ||
}), | ||
babel({ | ||
babelrc: false, | ||
presets: [ | ||
['@babel/preset-env', { | ||
modules: false | ||
}] | ||
], | ||
plugins: [ | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-proposal-object-rest-spread', | ||
'@babel/plugin-syntax-dynamic-import', | ||
['@babel/plugin-transform-react-jsx', { | ||
'pragma': 'Nerv.createElement' | ||
}] | ||
] | ||
}), | ||
commonjs({ | ||
include: ['../taro-mobx-common/index.js'], | ||
namedExports: { | ||
'../taro-mobx-common/index.js': [ | ||
'observer', 'inject', 'setStore' | ||
] | ||
} | ||
}) | ||
], | ||
watch: { | ||
include: 'src/**', | ||
clearScreen: true | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component } from '@tarojs/taro-h5' | ||
import { createElement } from 'nervjs' | ||
import { inject as originInject } from '@tarojs/mobx-common' | ||
|
||
export function inject () { | ||
return originInject(...arguments, { Component, createElement }) | ||
} | ||
|
||
export { observer } from '@tarojs/mobx-common' | ||
|
||
export { default as Provider } from './Provider' |