This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
doesn't work with Typescript #22
Comments
Error comes from typescript, not from But you can use babel with import url from 'rollup-plugin-url'
import babel from 'rollup-plugin-babel'
export default [{
input: 'bug-ts.ts',
output: [
{
file: 'dist/bug-ts.js',
name: 'BugTs',
format: 'esm',
sourcemap: true
}
],
plugins: [
babel({
exclude: 'node_modules/**',
extensions: ['.ts'],
presets: ["@babel/preset-typescript"]
}),
url()
]
}] |
Hi! That looks like a workaround, thanks for this solution, but still I think it should work out of the box with typescript2 plugin. Here is why:
|
|
As i expected issue should be fixed on typescript level, it can be done with custom typings declare module "*.png" {
const value: any;
export default value;
} It tells typescript how to handle Based on https://stackoverflow.com/a/51163365 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Works fine with plain JavaScript, but doesn't work with Typescript. Here is the repository for reproducing: https://github.com/AntonPilyak/rollup-image-bug
The text was updated successfully, but these errors were encountered: