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

Importing html files does not work #1082

Closed
otoinsa opened this issue Mar 28, 2018 · 2 comments
Closed

Importing html files does not work #1082

otoinsa opened this issue Mar 28, 2018 · 2 comments

Comments

@otoinsa
Copy link

otoinsa commented Mar 28, 2018

🐛 bug report

{
  "name": "parcel-html-import-issue",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel index.html"
  },
  "author": "",
  "license": "ISC",
  "description": "",
  "devDependencies": {
    "parcel-bundler": "^1.6.2"
  }
}

index.html

<html>
	<head>
		<script src="index.js"></script>
	</head>
</html>

test.html

<div>
	test
</div>

index.js

import testHtml from './test.html'

console.log(testHtml)

🤔 Expected Behavior

Should be URI to html file, but produces module error:
image

Here's the project for good measure:
parcel-html-import-issue.zip

Software Version(s)
Parcel 1.6.2
Node 8.9.4
npm/Yarn 5.6.0
Operating System Mac OS X
@teabyii
Copy link

teabyii commented Mar 30, 2018

I think it is not a bug, but feature request. Maybe you can take a look at this PR: Import/require html from js. @otoinsa

@devongovett
Copy link
Member

Closing. An HTML bundler loader was added to Parcel a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants