2 Star 1 Fork 3

白书科技 / thinkphp5与vuejs结合的代码

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
webpack.config.js 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin');
const extractSass = new ExtractTextPlugin({
filename: "[name].[hash].css",
disable: process.env.NODE_ENV === "development"
});
module.exports = {
entry: './vuejs/app.js',
output: {
filename: 'app.js',
path: path.resolve(__dirname, './public/static'),
publicPath: '/static/'
},
module: {
rules: [
{
test: /\.scss$/,
use: extractSass.extract({
use: [{
loader: "css-loader"
}, {
loader: "sass-loader"
}],
fallback: "style-loader"
})
},
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
use: [
'style-loader',
'css-loader'
]
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: [
"file-loader"
]
},
{
test: /\.(png|svg|jpg|gif)$/,
use: [
'file-loader'
]
},
]
},
plugins: [
new CleanWebpackPlugin(['dist']),
extractSass,
new VueLoaderPlugin()
],
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
}
1
https://gitee.com/myteng/thinkphp5_and_vuejs_code.git
git@gitee.com:myteng/thinkphp5_and_vuejs_code.git
myteng
thinkphp5_and_vuejs_code
thinkphp5与vuejs结合的代码
master

搜索帮助