Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test case for relative urls #2866

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,3 @@
import logo from "./images/logo.svg";

export default logo;
16 changes: 16 additions & 0 deletions packages/core/integration-tests/test/javascript.js
Expand Up @@ -1687,6 +1687,22 @@ describe('javascript', function() {
assert.equal(test, 2);
});

it('should correctly reference a relative raw import', async function() {
let b = await bundle(
path.join(__dirname, `/integration/js-import-relative-raw/index.js`)
);

let module = await run(b);
assert(
module.default.startsWith('/logo'),
module.default + ' starts with `/logo`'
);
assert(
await fs.exists(path.join(__dirname, 'dist', module.default), 'utf8'),
module.default + ' exists in dist'
);
});

it('should not dedupe imports with different contents', async function() {
let b = await bundle(
path.join(__dirname, `/integration/js-different-contents/index.js`),
Expand Down
63 changes: 0 additions & 63 deletions yarn.lock
Expand Up @@ -7937,69 +7937,6 @@ parallel-transform@^1.1.0:
inherits "^2.0.3"
readable-stream "^2.1.5"

parcel-bundler@^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==
dependencies:
"@babel/code-frame" "^7.0.0 <7.4.0"
"@babel/core" "^7.0.0 <7.4.0"
"@babel/generator" "^7.0.0 <7.4.0"
"@babel/parser" "^7.0.0 <7.4.0"
"@babel/plugin-transform-flow-strip-types" "^7.0.0 <7.4.0"
"@babel/plugin-transform-modules-commonjs" "^7.0.0 <7.4.0"
"@babel/plugin-transform-react-jsx" "^7.0.0 <7.4.0"
"@babel/preset-env" "^7.0.0 <7.4.0"
"@babel/runtime" "^7.0.0 <7.4.0"
"@babel/template" "^7.0.0 <7.4.0"
"@babel/traverse" "^7.0.0 <7.4.0"
"@babel/types" "^7.0.0 <7.4.0"
"@iarna/toml" "^2.2.0"
"@parcel/fs" "^1.11.0"
"@parcel/logger" "^1.11.0"
"@parcel/utils" "^1.11.0"
"@parcel/watcher" "^1.12.0"
"@parcel/workers" "^1.11.0"
ansi-to-html "^0.6.4"
babylon-walk "^1.0.2"
browserslist "^4.1.0"
chalk "^2.1.0"
clone "^2.1.1"
command-exists "^1.2.6"
commander "^2.11.0"
cross-spawn "^6.0.4"
css-modules-loader-core "^1.1.0"
cssnano "^4.0.0"
deasync "^0.1.14"
dotenv "^5.0.0"
dotenv-expand "^4.2.0"
fast-glob "^2.2.2"
filesize "^3.6.0"
get-port "^3.2.0"
htmlnano "^0.2.2"
is-glob "^4.0.0"
is-url "^1.2.2"
js-yaml "^3.10.0"
json5 "^1.0.1"
micromatch "^3.0.4"
mkdirp "^0.5.1"
node-forge "^0.7.1"
node-libs-browser "^2.0.0"
opn "^5.1.0"
postcss "^7.0.11"
postcss-value-parser "^3.3.1"
posthtml "^0.11.2"
posthtml-parser "^0.4.0"
posthtml-render "^1.1.3"
resolve "^1.4.0"
semver "^5.4.1"
serialize-to-js "^1.1.1"
serve-static "^1.12.4"
source-map "0.6.1"
terser "^3.7.3"
v8-compile-cache "^2.0.0"
ws "^5.1.1"

parse-asn1@^5.0.0:
version "5.1.4"
resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.4.tgz#37f6628f823fbdeb2273b4d540434a22f3ef1fcc"
Expand Down