-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from ice-lab/ice-scripts/release-2.1.6
ice-scripts/release-2.1.6
- Loading branch information
Showing
18 changed files
with
118 additions
and
36 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
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,9 @@ | ||
# Changelog | ||
|
||
## 0.1.1 | ||
|
||
- [fix] 添加 babel-runtime-jsx-plus 查找目录 | ||
|
||
## 0.1.0 | ||
|
||
- [feat] 完成初始版本基础功能 |
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 @@ | ||
# ice-plugin-jsx-plus |
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,41 @@ | ||
const path = require('path'); | ||
|
||
module.exports = ({ chainWebpack }) => { | ||
// Babel plugins for JSX+ | ||
const plugins = [ | ||
'babel-plugin-transform-jsx-list', | ||
'babel-plugin-transform-jsx-condition', | ||
'babel-plugin-transform-jsx-memo', | ||
'babel-plugin-transform-jsx-slot', | ||
['babel-plugin-transform-jsx-fragment', { moduleName: 'react' }], | ||
'babel-plugin-transform-jsx-class', | ||
]; | ||
chainWebpack((config) => { | ||
// modify babel config | ||
['jsx', 'tsx'].forEach((rule) => { | ||
config.module | ||
.rule(rule) | ||
.use('babel-loader') | ||
.tap((options) => { | ||
plugins.forEach(plugin => { | ||
if (typeof plugin === 'string') { | ||
options.plugins.push(require.resolve(plugin)); | ||
} else if (Array.isArray(plugin)) { | ||
const [pluginName, pluginOption] = plugin; | ||
options.plugins.push([ | ||
require.resolve(pluginName), | ||
pluginOption, | ||
]); | ||
} | ||
}); | ||
return options; | ||
}); | ||
}); | ||
|
||
// add resolve modules for babel-runtime-jsx-plus | ||
const runtimePath = require.resolve('babel-runtime-jsx-plus'); | ||
const pathArr = runtimePath.split('node_modules'); | ||
pathArr.pop(); // pop file path | ||
config.resolve.modules.add(path.join(pathArr.join('node_modules'), 'node_modules')); | ||
}); | ||
}; |
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,24 @@ | ||
{ | ||
"name": "ice-plugin-jsx-plus", | ||
"version": "0.1.1", | ||
"description": "ice plugin for jsx plus", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"test\"" | ||
}, | ||
"keywords": [ | ||
"ice", | ||
"ice-plugin" | ||
], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"babel-plugin-transform-jsx-class": "^0.1.2", | ||
"babel-plugin-transform-jsx-condition": "^0.1.1", | ||
"babel-plugin-transform-jsx-fragment": "^0.1.1", | ||
"babel-plugin-transform-jsx-list": "^0.1.0", | ||
"babel-plugin-transform-jsx-memo": "^0.1.2", | ||
"babel-plugin-transform-jsx-slot": "^0.1.1", | ||
"babel-runtime-jsx-plus": "^0.1.3" | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import 'core-js/stable'; | ||
import 'regenerator-runtime/runtime'; |
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
7 changes: 7 additions & 0 deletions
7
packages/ice-scripts/lib/plugins/userConfig/utils/polyfillLoader.js
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,7 @@ | ||
module.exports = (content) => { | ||
return ` | ||
import "core-js/stable"; | ||
import "regenerator-runtime/runtime"; | ||
${content} | ||
`; | ||
}; |
This file was deleted.
Oops, something went wrong.
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