how to compile a javascript file before impoted by raw-loader?
Asked Answered
G

0

7

I want to import a .js file as string with raw-loader, however the .js file is written with ES6 module, I want to compile and bundle the file with babel and webpack before import it by raw-loader.

In my code, I want to use like:

import SomeScriptsString from '!raw-loader!./my-module-file.js'

// use SomeScriptsString as a string

Could any one can help?

Gradualism answered 31/8, 2018 at 8:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.