JosephusPaye / Keen-UI

A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.
https://josephuspaye.github.io/Keen-UI/
MIT License
4.1k stars 438 forks source link

How to use it with browserify? #385

Open guillenotfound opened 6 years ago

guillenotfound commented 6 years ago

Hello, I'm trying to use the library with browserify but no success so far.

I'd like to import only the modules I need so:

<template>
  <ui-snackbar>just a test</ui-snackbar>
</template>

<script>
module.exports = {
    components: {
        "ui-snackbar": require('keen-ui/lib/UiSnackbar')
    }
}
</script>

But I get:

Error: Cannot find module '!!../node_modules/css-loader/index.js!../node_modules/vue-loader/lib/style-compiler/index.js?{"vue":true,"id":"data-v-39a27af7","scoped":false,"hasInlineConfig":true}!../node_modules/sass-loader/index.js!../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./UiIcon.vue' from 'project_path/node_modules/keen-ui/lib'

Am I doing something wrong? Thanks in advice.

guillenotfound commented 6 years ago

I was able to use it but since I'm only using some components would be awesome to have the style of those when importing them, otherwise I have to load de whole css file....

JosephusPaye commented 6 years ago

Hi,

I haven't used it with Browserify, but it seems like you should be able to use it with vueify. There's nothing webpack-specific in the Keen UI code.

Hope that helps.

guillenotfound commented 6 years ago

We manage to use it, but it's a drawback to import the whole css file, it's possible to have also a scss version when you publish it? Browserify doesn't support import css files by default, so sass would be fine.