如何通过Webpacker将材料组件用于Web

时间:2018-10-02 00:59:11

标签: ruby-on-rails webpack webpacker

Rails 5.2.1 webpacker4.0

app / javascript / application.scss

@import "material-components-web/material-components-web";

我将webpacker与默认设置一起使用,但是效果不佳。 我还需要哪些其他设置? 我想在webpacker中使用material-components-web

err

Module build failed:
@import "@material/base/mixins";
File to import not found or unreadable: @material/base/mixins.

webpack / environment.js

const { environment } = require('@rails/webpacker')
const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const vue =  require('./loaders/vue')

environment.plugins.append('VueLoaderPlugin', new VueLoaderPlugin())
environment.loaders.append('vue', vue)
module.exports = environment

0 个答案:

没有答案