babel-plugin-dual-import
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,2 +0,2 @@ | ||
{"/home/travis/build/faceyspacey/babel-plugin-dual-import/index.js": {"path":"/home/travis/build/faceyspacey/babel-plugin-dual-import/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":73,"column":1}},"1":{"start":{"line":2,"column":18},"end":{"line":2,"column":35}},"2":{"start":{"line":3,"column":22},"end":{"line":3,"column":43}},"3":{"start":{"line":4,"column":23},"end":{"line":4,"column":100}},"4":{"start":{"line":5,"column":27},"end":{"line":5,"column":64}},"5":{"start":{"line":5,"column":32},"end":{"line":5,"column":64}},"6":{"start":{"line":6,"column":24},"end":{"line":6,"column":73}},"7":{"start":{"line":6,"column":35},"end":{"line":6,"column":73}},"8":{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},"9":{"start":{"line":10,"column":24},"end":{"line":14,"column":7}},"10":{"start":{"line":15,"column":6},"end":{"line":15,"column":41}},"11":{"start":{"line":18,"column":4},"end":{"line":18,"column":34}},"12":{"start":{"line":22,"column":4},"end":{"line":32,"column":5}},"13":{"start":{"line":23,"column":21},"end":{"line":23,"column":50}},"14":{"start":{"line":24,"column":22},"end":{"line":24,"column":59}},"15":{"start":{"line":25,"column":6},"end":{"line":27,"column":8}},"16":{"start":{"line":29,"column":6},"end":{"line":31,"column":8}},"17":{"start":{"line":34,"column":23},"end":{"line":34,"column":57}},"18":{"start":{"line":35,"column":4},"end":{"line":35,"column":38}},"19":{"start":{"line":39,"column":36},"end":{"line":39,"column":49}},"20":{"start":{"line":40,"column":4},"end":{"line":40,"column":58}},"21":{"start":{"line":40,"column":17},"end":{"line":40,"column":58}},"22":{"start":{"line":42,"column":20},"end":{"line":42,"column":42}},"23":{"start":{"line":43,"column":27},"end":{"line":43,"column":49}},"24":{"start":{"line":44,"column":22},"end":{"line":44,"column":67}},"25":{"start":{"line":45,"column":4},"end":{"line":45,"column":35}},"26":{"start":{"line":49,"column":20},"end":{"line":49,"column":39}},"27":{"start":{"line":50,"column":26},"end":{"line":50,"column":38}},"28":{"start":{"line":51,"column":22},"end":{"line":51,"column":61}},"29":{"start":{"line":53,"column":4},"end":{"line":53,"column":39}},"30":{"start":{"line":54,"column":4},"end":{"line":54,"column":71}},"31":{"start":{"line":56,"column":4},"end":{"line":60,"column":17}},"32":{"start":{"line":63,"column":2},"end":{"line":72,"column":3}},"33":{"start":{"line":67,"column":8},"end":{"line":67,"column":30}},"34":{"start":{"line":67,"column":24},"end":{"line":67,"column":30}},"35":{"start":{"line":68,"column":8},"end":{"line":68,"column":25}},"36":{"start":{"line":69,"column":8},"end":{"line":69,"column":47}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":51},"end":{"line":73,"column":1}},"line":1},"1":{"name":"(anonymous_1)","decl":{"start":{"line":5,"column":27},"end":{"line":5,"column":28}},"loc":{"start":{"line":5,"column":32},"end":{"line":5,"column":64}},"line":5},"2":{"name":"(anonymous_2)","decl":{"start":{"line":6,"column":24},"end":{"line":6,"column":25}},"loc":{"start":{"line":6,"column":35},"end":{"line":6,"column":73}},"line":6},"3":{"name":"getImportCss","decl":{"start":{"line":8,"column":11},"end":{"line":8,"column":23}},"loc":{"start":{"line":8,"column":27},"end":{"line":19,"column":3}},"line":8},"4":{"name":"createTrimmedChunkName","decl":{"start":{"line":21,"column":11},"end":{"line":21,"column":33}},"loc":{"start":{"line":21,"column":49},"end":{"line":36,"column":3}},"line":21},"5":{"name":"getMagicCommentChunkName","decl":{"start":{"line":38,"column":11},"end":{"line":38,"column":35}},"loc":{"start":{"line":38,"column":51},"end":{"line":46,"column":3}},"line":38},"6":{"name":"promiseAll","decl":{"start":{"line":48,"column":11},"end":{"line":48,"column":21}},"loc":{"start":{"line":48,"column":25},"end":{"line":61,"column":3}},"line":48}},"branchMap":{"0":{"loc":{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},"type":"if","locations":[{"start":{"line":9,"column":4},"end":{"line":16,"column":5}},{"start":{"line":9,"column":4},"end":{"line":16,"column":5}}],"line":9},"1":{"loc":{"start":{"line":22,"column":4},"end":{"line":32,"column":5}},"type":"if","locations":[{"start":{"line":22,"column":4},"end":{"line":32,"column":5}},{"start":{"line":22,"column":4},"end":{"line":32,"column":5}}],"line":22},"2":{"loc":{"start":{"line":40,"column":4},"end":{"line":40,"column":58}},"type":"if","locations":[{"start":{"line":40,"column":4},"end":{"line":40,"column":58}},{"start":{"line":40,"column":4},"end":{"line":40,"column":58}}],"line":40},"3":{"loc":{"start":{"line":44,"column":33},"end":{"line":44,"column":66}},"type":"cond-expr","locations":[{"start":{"line":44,"column":50},"end":{"line":44,"column":61}},{"start":{"line":44,"column":64},"end":{"line":44,"column":66}}],"line":44},"4":{"loc":{"start":{"line":67,"column":8},"end":{"line":67,"column":30}},"type":"if","locations":[{"start":{"line":67,"column":8},"end":{"line":67,"column":30}},{"start":{"line":67,"column":8},"end":{"line":67,"column":30}}],"line":67}},"s":{"0":1,"1":2,"2":2,"3":2,"4":2,"5":8,"6":2,"7":16,"8":8,"9":8,"10":8,"11":8,"12":8,"13":5,"14":5,"15":5,"16":5,"17":3,"18":3,"19":8,"20":8,"21":3,"22":5,"23":5,"24":5,"25":5,"26":8,"27":8,"28":8,"29":8,"30":8,"31":8,"32":2,"33":16,"34":8,"35":8,"36":8},"f":{"0":2,"1":8,"2":16,"3":8,"4":8,"5":8,"6":8},"b":{"0":[8,0],"1":[5,3],"2":[3,5],"3":[3,2],"4":[8,8]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"a0790cf94878536b0a86415133b6e4111854220b"} | ||
{"/home/travis/build/faceyspacey/babel-plugin-dual-import/index.js": {"path":"/home/travis/build/faceyspacey/babel-plugin-dual-import/index.js","statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":75,"column":1}},"1":{"start":{"line":2,"column":18},"end":{"line":2,"column":35}},"2":{"start":{"line":3,"column":22},"end":{"line":3,"column":43}},"3":{"start":{"line":4,"column":23},"end":{"line":6,"column":3}},"4":{"start":{"line":7,"column":27},"end":{"line":7,"column":64}},"5":{"start":{"line":7,"column":32},"end":{"line":7,"column":64}},"6":{"start":{"line":8,"column":24},"end":{"line":8,"column":73}},"7":{"start":{"line":8,"column":35},"end":{"line":8,"column":73}},"8":{"start":{"line":11,"column":4},"end":{"line":18,"column":5}},"9":{"start":{"line":12,"column":24},"end":{"line":16,"column":7}},"10":{"start":{"line":17,"column":6},"end":{"line":17,"column":41}},"11":{"start":{"line":20,"column":4},"end":{"line":20,"column":34}},"12":{"start":{"line":24,"column":4},"end":{"line":34,"column":5}},"13":{"start":{"line":25,"column":21},"end":{"line":25,"column":50}},"14":{"start":{"line":26,"column":22},"end":{"line":26,"column":59}},"15":{"start":{"line":27,"column":6},"end":{"line":29,"column":8}},"16":{"start":{"line":31,"column":6},"end":{"line":33,"column":8}},"17":{"start":{"line":36,"column":23},"end":{"line":36,"column":57}},"18":{"start":{"line":37,"column":4},"end":{"line":37,"column":38}},"19":{"start":{"line":41,"column":36},"end":{"line":41,"column":49}},"20":{"start":{"line":42,"column":4},"end":{"line":42,"column":58}},"21":{"start":{"line":42,"column":17},"end":{"line":42,"column":58}},"22":{"start":{"line":44,"column":20},"end":{"line":44,"column":42}},"23":{"start":{"line":45,"column":27},"end":{"line":45,"column":49}},"24":{"start":{"line":46,"column":22},"end":{"line":46,"column":67}},"25":{"start":{"line":47,"column":4},"end":{"line":47,"column":35}},"26":{"start":{"line":51,"column":20},"end":{"line":51,"column":39}},"27":{"start":{"line":52,"column":26},"end":{"line":52,"column":38}},"28":{"start":{"line":53,"column":22},"end":{"line":53,"column":61}},"29":{"start":{"line":55,"column":4},"end":{"line":55,"column":39}},"30":{"start":{"line":56,"column":4},"end":{"line":56,"column":71}},"31":{"start":{"line":58,"column":4},"end":{"line":62,"column":17}},"32":{"start":{"line":65,"column":2},"end":{"line":74,"column":3}},"33":{"start":{"line":69,"column":8},"end":{"line":69,"column":30}},"34":{"start":{"line":69,"column":24},"end":{"line":69,"column":30}},"35":{"start":{"line":70,"column":8},"end":{"line":70,"column":25}},"36":{"start":{"line":71,"column":8},"end":{"line":71,"column":47}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}},"loc":{"start":{"line":1,"column":51},"end":{"line":75,"column":1}},"line":1},"1":{"name":"(anonymous_1)","decl":{"start":{"line":7,"column":27},"end":{"line":7,"column":28}},"loc":{"start":{"line":7,"column":32},"end":{"line":7,"column":64}},"line":7},"2":{"name":"(anonymous_2)","decl":{"start":{"line":8,"column":24},"end":{"line":8,"column":25}},"loc":{"start":{"line":8,"column":35},"end":{"line":8,"column":73}},"line":8},"3":{"name":"getImportCss","decl":{"start":{"line":10,"column":11},"end":{"line":10,"column":23}},"loc":{"start":{"line":10,"column":27},"end":{"line":21,"column":3}},"line":10},"4":{"name":"createTrimmedChunkName","decl":{"start":{"line":23,"column":11},"end":{"line":23,"column":33}},"loc":{"start":{"line":23,"column":49},"end":{"line":38,"column":3}},"line":23},"5":{"name":"getMagicCommentChunkName","decl":{"start":{"line":40,"column":11},"end":{"line":40,"column":35}},"loc":{"start":{"line":40,"column":51},"end":{"line":48,"column":3}},"line":40},"6":{"name":"promiseAll","decl":{"start":{"line":50,"column":11},"end":{"line":50,"column":21}},"loc":{"start":{"line":50,"column":25},"end":{"line":63,"column":3}},"line":50}},"branchMap":{"0":{"loc":{"start":{"line":11,"column":4},"end":{"line":18,"column":5}},"type":"if","locations":[{"start":{"line":11,"column":4},"end":{"line":18,"column":5}},{"start":{"line":11,"column":4},"end":{"line":18,"column":5}}],"line":11},"1":{"loc":{"start":{"line":24,"column":4},"end":{"line":34,"column":5}},"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":34,"column":5}},{"start":{"line":24,"column":4},"end":{"line":34,"column":5}}],"line":24},"2":{"loc":{"start":{"line":42,"column":4},"end":{"line":42,"column":58}},"type":"if","locations":[{"start":{"line":42,"column":4},"end":{"line":42,"column":58}},{"start":{"line":42,"column":4},"end":{"line":42,"column":58}}],"line":42},"3":{"loc":{"start":{"line":46,"column":33},"end":{"line":46,"column":66}},"type":"cond-expr","locations":[{"start":{"line":46,"column":50},"end":{"line":46,"column":61}},{"start":{"line":46,"column":64},"end":{"line":46,"column":66}}],"line":46},"4":{"loc":{"start":{"line":69,"column":8},"end":{"line":69,"column":30}},"type":"if","locations":[{"start":{"line":69,"column":8},"end":{"line":69,"column":30}},{"start":{"line":69,"column":8},"end":{"line":69,"column":30}}],"line":69}},"s":{"0":1,"1":2,"2":2,"3":2,"4":2,"5":8,"6":2,"7":16,"8":8,"9":8,"10":8,"11":8,"12":8,"13":5,"14":5,"15":5,"16":5,"17":3,"18":3,"19":8,"20":8,"21":3,"22":5,"23":5,"24":5,"25":5,"26":8,"27":8,"28":8,"29":8,"30":8,"31":8,"32":2,"33":16,"34":8,"35":8,"36":8},"f":{"0":2,"1":8,"2":16,"3":8,"4":8,"5":8,"6":8},"b":{"0":[8,0],"1":[5,3],"2":[3,5],"3":[3,2],"4":[8,8]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"d4f05ad31aaa5dd609fc241b5a683cf7fba108da"} | ||
} |
module.exports = function ({ types: t, template }) { | ||
const visited = Symbol('visited') | ||
const importCssId = Symbol('importCssId') | ||
const loadTemplate = template('Promise.all([IMPORT, IMPORT_CSS(MODULE)]).then(proms => proms[0])') | ||
const loadTemplate = template( | ||
'Promise.all([IMPORT, IMPORT_CSS(MODULE)]).then(proms => proms[0])' | ||
) | ||
const getImportArgPath = p => p.parentPath.get('arguments')[0] | ||
@@ -11,3 +13,3 @@ const trimChunkName = baseDir => baseDir.replace(/^[./]+|(\.js$)/g, '') | ||
const importCss = p.hub.file.addImport( | ||
'babel-plugin-universal-import/importCss.js', | ||
'babel-plugin-dual-import/importCss.js', | ||
'default', | ||
@@ -14,0 +16,0 @@ 'importCss' |
{ | ||
"name": "babel-plugin-dual-import", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Babel plugin to import() both js + css", | ||
@@ -28,4 +28,9 @@ "main": "index.js", | ||
"babel-eslint": "^7.2.3", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-plugin-tester": "^3.1.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"babylon-options": "^1.1.2", | ||
"commitizen": "^2.9.6", | ||
"cz-conventional-changelog": "^2.0.0", | ||
@@ -44,7 +49,3 @@ "eslint": "^3.19.0", | ||
"semantic-release": "^6.3.6", | ||
"travis-github-status": "^1.6.1", | ||
"babel-plugin-syntax-dynamic-import": "^6.18.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1" | ||
"travis-github-status": "^1.6.1" | ||
}, | ||
@@ -51,0 +52,0 @@ "config": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
323022
538
24