Parcel: Use of libs with old dependencies (jQuery, jQuery-ui, angular 1.5.x, etc)

Created on 9 Jan 2018  路  3Comments  路  Source: parcel-bundler/parcel

I'm having problems importing jQuery ui dependency (and lof of others) with parcel.

I need a way to ask parcel to just concatenate js scripts, without making a module from each file.

Here is how it's being imported in code:

require('@bower_components/jquery');
require('@bower_components/jquery-ui');

And here is package.json
(actually yarn is used instead of bower now, just "old" folder name to obviously see that these packages are for browser)

    "@bower_components/jquery": "jquery/jquery-dist#^2.2.4",
    "@bower_components/jquery-deserialize": "kflorence/jquery-deserialize#^1.3.3",
    "@bower_components/jquery-ui": "components/jqueryui#^1.11.4",

I have no babel configured yet.

馃 Expected Behavior

Somehow parcel should be able to just concatenate js files
( old style, I know, but project still exists with old dependencies :( )

馃槸 Current Behavior

Getting exceptions in console:

a677f712e4edd09e274282973659f9b7.js:9903 Uncaught ReferenceError: jQuery is not defined
    at a677f712e4edd09e274282973659f9b7.js:9903
    at Object.require.62 (a677f712e4edd09e274282973659f9b7.js:9905)
    at newRequire (a677f712e4edd09e274282973659f9b7.js:42)
    at localRequire (a677f712e4edd09e274282973659f9b7.js:48)
    at Object.require.2.@bower_components/jquery (a677f712e4edd09e274282973659f9b7.js:28598)
    at newRequire (a677f712e4edd09e274282973659f9b7.js:42)
    at require.61 (a677f712e4edd09e274282973659f9b7.js:67)

馃拋 Possible Solution

parcel ignore flag/config/comment?

馃敠 Context

I'm trying to move old project with builds on gulp/grunt (raw concatenation of js files + babel afterwards) to parcel.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | latest
| Node | v8.9.3
| npm/Yarn | 1.3.2
| Operating System | osx 10.13.2

Most helpful comment

related to #333 ?

All 3 comments

btw implementing/fixing this will make Parcel even faster :-D

related to #333 ?

@DeMoorJasper Seems exactly related

Was this page helpful?
0 / 5 - 0 ratings