[Question] How to make @import "~bootstrap/scss/bootstrap" work?
See original GitHub issueIn main.js I have import a style.scss file, and in style.scss, I use @import “~bootstrap/scss/bootstrap” like I often do with webpack but rollup doesnot understand ~ sign is node_modules folder this is my rollup.config.js
import alias from 'rollup-plugin-alias'
import vue from 'rollup-plugin-vue'
import buble from 'rollup-plugin-buble'
import nodeResolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import nodeGlobals from 'rollup-plugin-node-globals'
import butternut from 'rollup-plugin-butternut'
import livereload from 'rollup-plugin-livereload'
import serve from 'rollup-plugin-serve'
import scss from 'rollup-plugin-scss'
const plugins = [
alias({
vue$: 'vue/dist/vue.common.js'
}),
vue({
autoStyles: false,
styleToImports: true
}),
scss({
output: 'public/assets/css/app.css',
includePaths: [
'./node_modules'
]
}),
buble({
objectAssign: 'Object.assign'
}),
nodeResolve({
jsnext: true,
main: true,
browser: true
}),
commonjs(),
nodeGlobals()
]
const config = {
input: './src/main.js',
output: {
file: './public/assets/js/app.js',
format: 'es'
},
sourcemap: 'inline',
plugins: plugins
}
const isProduction = process.env.NODE_ENV === `production`
const isDevelopment = process.env.NODE_ENV === `development`
if (isProduction) {
config.sourceMap = false
config.plugins.push(butternut())
}
if (isDevelopment) {
config.plugins.push(livereload())
config.plugins.push(serve({
contentBase: './public/',
port: 8080,
open: true
}))
}
export default config
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Sass · Bootstrap v5.0
In your custom.scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you...
Read more >How do I import bootstrap-sass once and use it in several files?
The way to import an SCSS file is to use that import command inside the parent SCSS file at the top. So if...
Read more >Learn Bootstrap 5 and SASS by Building a Portfolio Website
Learn Bootstrap 5 and Sass by building a portfolio website. Bootstrap is one of the most popular CSS frameworks and Sass is one...
Read more >Getting Started with Bootstrap 5, React, and Sass - Designmodo
Get React JS and Bootstrap 5 install and integrate together using npm. Setup Sass for different screen resolutions of your app.
Read more >10 Most Common Bootstrap Mistakes That Developers Make
Don't know LESS or SASS? No problem, you can create your own CSS file and overwrite whatever you want from the original bootstrap.css...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I still meet this issue so far ? Any suggest ?
I’ve run into this exact same issue. Can rollup-plugin-scss support the ~ or not?
Update: Tilde’s seem to load properly when I use the node-sass-tilde-importer: