友链
导航
These are the good times in your life,
so put on a smile and it'll be alright
友链
导航
{ test: /\.vue$/, loader: “vue-loader” }
// main.js var Vue = require('vue') var appOptions = require('./app.vue') var app = new Vue(appOptions).$mount('#app')
使用 CommonJs 的写法,管理所有前端资源,其中非 js 的部分能通过各种 loader 解析。
module.exports = { entry: "./entry.js", // 源码入口 output: { path: __dirname, // 输出目录 filename: "bundle.js" // 输出文件 }, module: { loaders: [ { test: /\.css$/, loader: "style!css" } // 符合 test 的 require,需要用 loader 解析 ] } };