material-components-vue
material-components-vue copied to clipboard
Lack of documentation for getting started with vue-cli
Describe the bug Lacks proper documentation for getting started with this library. I had to manually install sass-loader and still run into compilation issues.
To Reproduce Running webpack development server after installing this library and importing Buttons.vue as component and theme styles in the
Expected behavior A clear and concise Getting Started section.
Solution Add a Getting Started With Vue-Cli 3.X section to the documentation site.
- Install sass-loader
- Set vue.config.js as follows
const path = require("path")
module.exports = {
chainWebpack: config => {
config.module
.rule("scss")
.oneOf("vue-modules")
.use("sass-loader")
.tap(args => {
args.includePaths = ["./node_modules"]
return args
})
},
css: {
loaderOptions: {
sass: {
includePaths: [path.resolve(__dirname, "node_modules")],
data: `
@import "material-components-vue/theme/dist/styles";
`
},
},
},
}
@johnhorsema Personally, I use the following
const path = require('path')
const nodeModules = path.resolve('node_modules/')
module.exports = {
css: {
loaderOptions: {
sass: {
includePaths: [nodeModules]
}
}
}
}
Reference: https://github.com/material-components/material-components-web/blob/master/docs/getting-started.md
I'm also considering creating a vue-cli template.
Pull request is welcomed.
Another example is in https://github.com/Kava-Labs/switch/blob/master/vue.config.js
@matsp help wanted in all issues related to docs.