Skip to content

Commit

Permalink
fix: parcel dependency and supported extensions
Browse files Browse the repository at this point in the history
- Move to `parcel` package instead of `parcel-bundler`
- Add jsx, tsx, ts to supported file extensions
  • Loading branch information
Ty3uK authored and satya164 committed Jul 5, 2019
1 parent c4d3632 commit c7bc83e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"jest": "^24.1.0",
"linaria": "^1.1.4",
"parcel-assert-bundle-tree": "^1.0.0",
"parcel-bundler": "^1.12.3",
"parcel": "^1.12.3",
"parcel-plugin-linaria": "link:.",
"prettier": "^1.16.4",
"react": "^16.8.3",
Expand All @@ -36,7 +36,7 @@
},
"peerDependencies": {
"linaria": ">= 1.0.0",
"parcel-bundler": ">= 1.12.0"
"parcel": ">= 1.12.0"
},
"husky": {
"hooks": {
Expand Down
2 changes: 1 addition & 1 deletion src/LinariaAsset.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require('path');
const Module = require('module');
const JSAsset = require('parcel-bundler/src/assets/JSAsset');
const JSAsset = require('parcel/src/assets/JSAsset');
const transform = require('linaria/lib/transform');

const RESULT = Symbol('linaria-transform-result');
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Bundler = require('parcel-bundler');
const Bundler = require('parcel');
const assertBundleTree = require('parcel-assert-bundle-tree');
const path = require('path');
const LinariaPlugin = require('../index');
Expand Down
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/* eslint-disable func-names */

module.exports = function(bundler) {
bundler.addAssetType('js', require.resolve('./LinariaAsset'));
const LinariaAsset = require.resolve('./LinariaAsset');

bundler.addAssetType('js', LinariaAsset);
bundler.addAssetType('jsx', LinariaAsset);

bundler.addAssetType('ts', LinariaAsset);
bundler.addAssetType('tsx', LinariaAsset);
};
13 changes: 7 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6545,10 +6545,14 @@ parcel-assert-bundle-tree@^1.0.0:
resolved "https://registry.yarnpkg.com/parcel-assert-bundle-tree/-/parcel-assert-bundle-tree-1.0.0.tgz#d10a1bff6fb690cdbda5201cae216366c23c837e"
integrity sha512-PpEArwgoZGRCDdHLxFpjs4Rl5X8dAL0SUQ8uqsXVSJMDmbSbha1P28X2kWaTu2RVfwSswv7MSF0NA/qzn0H/IA==

parcel-bundler@^1.12.3:
"parcel-plugin-linaria@link:./.":
version "0.0.0"
uid ""

parcel@^1.12.3:
version "1.12.3"
resolved "https://registry.yarnpkg.com/parcel-bundler/-/parcel-bundler-1.12.3.tgz#2bbf70bfa2d06097f071653285040bd125684d09"
integrity sha512-8bq6lj0hhQeGxD9f9xEkFMXQ3d8TIlf2+isKxoi9bciB0KVEILRGllaPkUgp++5t0anToBh9+tG6ZyInXOC1/A==
resolved "https://registry.yarnpkg.com/parcel/-/parcel-1.12.3.tgz#1f1341589380f20be924f1dd67c7fed193b346ec"
integrity sha512-j9XCVLeol9qZvGemRKt2z8bptbXq9LVy8/IzjqWQKMiKd8DR0NpDAlRHV0zyF72/J/UUTsdsrhnw6UGo9nGI+Q==
dependencies:
"@babel/code-frame" "^7.0.0 <7.4.0"
"@babel/core" "^7.0.0 <7.4.0"
Expand Down Expand Up @@ -6608,9 +6612,6 @@ parcel-bundler@^1.12.3:
v8-compile-cache "^2.0.0"
ws "^5.1.1"

"parcel-plugin-linaria@link:./.":
version "0.1.1"

parent-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5"
Expand Down

0 comments on commit c7bc83e

Please sign in to comment.