简体   繁体   English

如何使用 Rollup 将 js 文件作为字符串导入?

[英]How to import js file as string with Rollup?

In Webpack, we have raw-loader to import files like .js as strings.在 Webpack 中,我们使用 raw-loader 将 .js 等文件作为字符串导入。 I'm using Rollup.我正在使用汇总。 Does Rollup has anything similar to that? Rollup 有类似的东西吗?

Turns out, you need a plugin for that.事实证明,你需要一个插件。

I found one today https://github.com/TrySound/rollup-plugin-string我今天找到了一个https://github.com/TrySound/rollup-plugin-string

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何导入 javascript 模块并将其捆绑到带有汇总的单个 js 文件中? - How to import javascript modules and bundle into a single js file with rollup? Rollup.js如何在没有任何更改的情况下导入js文件(不是es6模块)(myvar $ extrastring) - Rollup.js how import a js file (not es6 module) without any change (myvar$extrastring) 使用汇总将svelte html文件导入js文件 - Import svelte html file into js file using rollup 如何在 Rollup.js 中将依赖 package 的导入模块更改为替换该模块的本地文件? - How can I change in Rollup.js an import module of a dependency package to a local file replacing that module? 如何使用Rollup.JS写入文件 - How to write to file with Rollup.JS rollup.js单个导入多个用法 - rollup.js single import multiple usages 导入配置文件以在具有汇总功能的javascript应用程序中使用 - Import config file for use in javascript application with rollup Javascript,汇总:汇总内部文件中的“导入”语法在执行汇总时导致语法错误 - Javascript, rollup: “import” syntax in rollup internal file causes syntax error, when rollup is executed rollup.js 如何在不更改源文件的情况下导入其他文件 - rollup.js how to import additional files without changing source files 如何使用汇总导入内容 - How do I import something with rollup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM