Giter Site home page Giter Site logo

Comments (19)

egoist avatar egoist commented on August 15, 2024 1

Simply add it in .vue file would work?

<style src="bulma/css/bulma.css"></style>

from poi.

egoist avatar egoist commented on August 15, 2024 1

Something like this seems to work:

<style lang="sass">
  $blue: #72d0eb;
  @import "~bulma";
</style>

from poi.

egoist avatar egoist commented on August 15, 2024 1

@Sheetaldx the issue tracker is actually for Poi only, you may ask that on StackOverflow instead.

from poi.

codeofsumit avatar codeofsumit commented on August 15, 2024

ohh works like a charm. Thank you!

from poi.

codeofsumit avatar codeofsumit commented on August 15, 2024

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.

egoist avatar egoist commented on August 15, 2024

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.

codeofsumit avatar codeofsumit commented on August 15, 2024

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.

egoist avatar egoist commented on August 15, 2024

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.

codeofsumit avatar codeofsumit commented on August 15, 2024

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.

codeofsumit avatar codeofsumit commented on August 15, 2024

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.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

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 error

Error: 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.

egoist avatar egoist commented on August 15, 2024

@Sheetaldx hmm you should set it to lang="scss" if you want to import scss file

from poi.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

I am importing css file not .scss i mention wrong extension in above comment

from poi.

egoist avatar egoist commented on August 15, 2024

@Sheetaldx mind providing a repo or more details about the error?

from poi.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

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.

egoist avatar egoist commented on August 15, 2024

@Sheetaldx hmm what is this? is it even a Poi thing?

from poi.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

no its not Poi..., i am using framework7+vue

from poi.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

i am just trying to import a external css file

from poi.

Sheetaldx avatar Sheetaldx commented on August 15, 2024

ok thank u :)

from poi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.