-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Expected behavior
Expect to locate the .styl
file from node_modules
with ~
(which works well when bundled with Webpack)
<style lang="stylus" scoped>
@import '~@my-pkg/style.styl'
</style>
Actual behavior
Get the error:
failed to locate @import file ~@my-pkg/style.styl
at Evaluator.visitImport (C:\Users\dev\node_modules\stylus\lib\visitor\evaluator.js:915:21)
...
...
...
However, when I import the .styl
file with relative path:
<style lang="stylus">
@import '../node_modules/@my-pkg/style.styl'
</style>
It works fine.
Steps to reproduce the behavior
My rollup config:
import vue from 'rollup-plugin-vue'
import typescript from 'rollup-plugin-typescript2'
import nodeResolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json'
export default {
input: 'src/index.vue',
output: {
format: 'esm',
file: 'dist/bundle.esm.js'
},
plugins: [
nodeResolve({
jsnext: true,
main: true
}),
commonjs(),
json(),
typescript({
rollupCommonJSResolveHack: true,
useTsconfigDeclarationDir: true
}),
vue()
]
}
Metadata
Metadata
Assignees
Labels
No labels