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

Use for assets #19

Open
iBobik opened this issue Apr 18, 2020 · 1 comment
Open

Use for assets #19

iBobik opened this issue Apr 18, 2020 · 1 comment

Comments

@iBobik
Copy link

iBobik commented Apr 18, 2020

I expected I can use this plugin for including assets in Webpack build:

import html from 'https://example.com/'
export default {
  data () {
    return {
      html
    }
  }
}

But it fails:


Downloading https://example.com... (repeated 2 times)                      23:26:48

 ERROR  Failed to compile with 1 errors                                    friendly-errors 23:26:52

This dependency was not found:                                             friendly-errors 23:26:52
                                                                           friendly-errors 23:26:52
* https://example.com/ in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/pro-pruvodce.vue?vue&type=script&lang=js&
                                                                           friendly-errors 23:26:52
To install it, you can run: npm install --save https://example.com/

Do I use it incorrectly? How to do it correctly?

My motivation for using import for this (and not load it in the app) is to include it in app's build sources what will be deployed to a hosting together.

@egoist
Copy link
Owner

egoist commented May 8, 2020

the url needs to include a file path, e.g. http://example.com/index.html, and you need to configure your bundle to handle files that are not JavaScript modules.

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

No branches or pull requests

2 participants