diff --git a/packages/avet-build/lib/babel/preset.js b/packages/avet-build/lib/babel/preset.js index eb248b9..49097da 100644 --- a/packages/avet-build/lib/babel/preset.js +++ b/packages/avet-build/lib/babel/preset.js @@ -1,28 +1,6 @@ const relativeResolve = require('../root-module-relative-path')(require); const absoluteResolve = require('../absolute-path')(require); -// Resolve styled-jsx plugins -function styledJsxOptions(opts) { - if (!opts) { - return {}; - } - - if (!Array.isArray(opts.plugins)) { - return opts; - } - - opts.plugins = opts.plugins.map(plugin => { - if (Array.isArray(plugin)) { - const [ name, options ] = plugin; - return [ require.resolve(name), options ]; - } - - return require.resolve(plugin); - }); - - return opts; -} - const envPlugins = { development: [ require.resolve('babel-plugin-transform-react-jsx-source') ], production: [ @@ -52,10 +30,6 @@ module.exports = (context, opts = {}) => { require.resolve('babel-plugin-transform-runtime'), opts['transform-runtime'] || {}, ], - [ - require.resolve('styled-jsx/babel'), - styledJsxOptions(opts['styled-jsx']), - ], ...plugins, [ require.resolve('babel-plugin-module-resolver'), diff --git a/packages/avet-build/lib/createCompiler.js b/packages/avet-build/lib/createCompiler.js index 370b978..056e4a3 100644 --- a/packages/avet-build/lib/createCompiler.js +++ b/packages/avet-build/lib/createCompiler.js @@ -276,7 +276,6 @@ module.exports = async function createCompiler( 'avet/error': relativeResolve('avet-shared/lib/error'), 'avet/document': relativeResolve('../.external/document'), 'avet/config': relativeResolve('../.external/config'), - 'styled-jsx/style': relativeResolve('styled-jsx/style'), }, }, ], diff --git a/packages/avet-build/package.json b/packages/avet-build/package.json index 4080715..11317dd 100644 --- a/packages/avet-build/package.json +++ b/packages/avet-build/package.json @@ -5,10 +5,7 @@ "scripts": { "autod": "autod" }, - "files": [ - "lib", - "index.js" - ], + "files": ["lib", "index.js"], "dependencies": { "@taskr/babel": "^1.1.0", "@taskr/clear": "^1.1.0", @@ -45,7 +42,6 @@ "react-dom": "^16.0.0", "react-hot-loader": "^3.1.1", "rimraf": "^2.6.2", - "styled-jsx": "^2.2.0", "taskr": "^1.1.0", "traverse": "^0.6.6", "uglifyjs-webpack-plugin": "^1.0.1", diff --git a/packages/avet-core/lib/loader/mixin/config.js b/packages/avet-core/lib/loader/mixin/config.js index e4784d4..891882b 100644 --- a/packages/avet-core/lib/loader/mixin/config.js +++ b/packages/avet-core/lib/loader/mixin/config.js @@ -92,7 +92,7 @@ module.exports = { } } - _babelFnList.map(fn => { + _babelFnList.forEach(fn => { const babelConfig = fn(target.build.babel, target); assert(babelConfig, 'babel funtion need return babelConfig object');