如何将.vue文件中的所有css代码放入一个.css文件?

我开始VueJS,我从原始Vue加载程序示例开始我的代码,我testing运行npm run devnpm run build但出现了一个问题:有没有办法将所有的组件从一个地方(如样式.min.css)。

我在我的package.json中添加了bootstrap作为依赖关系,但是当我执行npm run build我只能finddist的build.js文件,就这些了。

感谢您的帮助。

有一个插件

 npm install extract-text-webpack-plugin --save-dev 

然后在你的webpack.config.js中configuration它

 var ExtractTextPlugin = require("extract-text-webpack-plugin"); module.exports = { // other options... module: { loaders: [ { test: /\.vue$/, loader: 'vue' }, ] }, vue: { loaders: { css: ExtractTextPlugin.extract("css"), // you can also include <style lang="less"> or other langauges less: ExtractTextPlugin.extract("css!less") } }, plugins: [ new ExtractTextPlugin("style.css") ] }