Comments (19)
Simply add it in .vue
file would work?
<style src="bulma/css/bulma.css"></style>
from poi.
Something like this seems to work:
<style lang="sass">
$blue: #72d0eb;
@import "~bulma";
</style>
from poi.
@Sheetaldx the issue tracker is actually for Poi only, you may ask that on StackOverflow instead.
from poi.
ohh works like a charm. Thank you!
from poi.
I'm sorry I have a follow-up question regarding sass. It seems like, contrary to my opening comment, sass-files only get loaded as standard css, without being compiled.
I think .scss
and .sass
files aren't compiled right now. Normally I'd use a webpack loader of course. How would I do this here?
from poi.
yeah, vbuild does not have built-in sass support, but you can custom this by:
// vue.config.js
module.exports = {
mergeConfig: {},
// or
production: {
mergeConfig: {
// webpack config
}
},
development: {
mergeConfig: {
// webpack config
}
}
}
from poi.
I'm still struggling to make this work.
This is my vue.config.js:
module.exports = {
title: 'my-app',
resolve: true,
mergeConfig: {
// following options will be merged
module: {
loaders: [
{
test: /\.scss$/,
loaders: ["sass"]
}
]
}
}
}
installed the loader via:
npm install sass-loader node-sass --save-dev
my package.json (I had to put in webpack due to peerDependency of sass-loader on npm3
{
"private": true,
"name": "my-app",
"scripts": {
"dev": "vbuild --dev",
"build": "vbuild"
},
"dependencies": {
"bulma": "^0.2.3",
"vue": "^2.0.0"
},
"devDependencies": {
"node-sass": "^3.11.2",
"sass-loader": "^4.0.2",
"webpack": "^2.1.0-beta"
}
}
and a simple test
app.scss
$blue: blue;
html {
color: $blue;
}
loaded into the default App.vue
<style src="../styles/app.scss"></style>
And the variable is not resolved.
What am I missing?
from poi.
eh, if you use sass directly in .vue
file, simply install the loader and:
<style lang="sass" src="./path/to/xxx.scss"></style>
from poi.
I would, but then I get trouble with external scss/sass resourced e.g. bulma:
neither this
<style lang="sass">
$blue: #00AFF8;
$primary: $blue;
</style>
<style src="bulma/bulma.sass"></style>
nor this
<style lang="sass">
$blue: #00AFF8;
$primary: $blue;
@import 'bulma/bulma.sass';
</style>
works (Build fails).
from poi.
ok that does work π.
And just saw your edit above π.
Now everything seems to be working beautifully.
I now do this:
<style lang="sass" src="../styles/app.scss"></style>
and inside app.scss:
$blue: #00AFF8;
$primary: $blue;
@import "~bulma";
html, body, .app {
height: 100%;
width: 100%;
}
// ... rest of my scss/css
Thanks for the quick support!
from poi.
Hello
I am very new to framework+vue i am trying to embed external css i am adding
<style lang="css" src="../static/Democss.scss"></style> in main.vue but there is compilation errorError: Error happened when webpack build: Error: Command failed: "/home/sheetal/DemoApp/node_modules/.bin/webpack"
please help how to call css in framewrok+v7
from poi.
@Sheetaldx hmm you should set it to lang="scss"
if you want to import scss file
from poi.
I am importing css file not .scss i mention wrong extension in above comment
from poi.
@Sheetaldx mind providing a repo or more details about the error?
from poi.
the error is
Before deploy hook started...
Checking is node modules installed...
Node modules already installed.
Starting webpack build...
Error happened when webpack build: Error: Command failed: "/home/sheetal/DemoApp/node_modules/.bin/webpack"
Webpack build completed to www folder successfully!
Error happened on main chain:
Error: Error happened when webpack build: Error: Command failed: "/home/sheetal/DemoApp/node_modules/.bin/webpack"
at exec (/home/sheetal/DemoApp/hooks/hookers.js:187:19)
at ChildProcess.exithandler (child_process.js:277:5)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at maybeClose (internal/child_process.js:927:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
Error: Error happened when webpack build: Error: Command failed: "/home/sheetal/DemoApp/node_modules/.bin/webpack"
from poi.
@Sheetaldx hmm what is this? is it even a Poi thing?
from poi.
no its not Poi..., i am using framework7+vue
from poi.
i am just trying to import a external css file
from poi.
ok thank u :)
from poi.
Related Issues (20)
- Add memoryLimit option to @poi/plugin-typescript plugin HOT 3
- Document how to override the target of the babel preset HOT 1
- Breakpoints sometimes don't work in Chrome devtools until save HOT 3
- Update to the latest version of webpack-dev-server HOT 12
- custom opitons support HOT 1
- config.entry and HTML entrypoint HOT 1
- [Bug] Vue files in node modules not updated HOT 2
- [Suggestion] Support react fast refresh ? HOT 1
- Typecast in Vue SFC prop results in Babel error? HOT 8
- [Question] How to remove console.log instructions on build ? HOT 4
- [Question] How can I get the document? HOT 3
- plugin-pwa bug HOT 1
- cant load scss
- Dev server history API fallback fails with pubilcUrl
- PostCSS version 8 support
- output.format ESM support? HOT 1
- Eslint logs issue
- θ½ε¦θΏθ‘ζ§εΆexcleεε ζ Όη¦ζ’ε€εΆ
- "Unknown word" error during CSS minification HOT 1
- Upgrade to Webpack 5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poi.