Конфиги для webpack
This commit is contained in:
60
build/webpack.base.config.js
Normal file
60
build/webpack.base.config.js
Normal file
@@ -0,0 +1,60 @@
|
||||
let path = require("path");
|
||||
let webpack = require("webpack");
|
||||
const VueLoaderPlugin = require('vue-loader/lib/plugin');
|
||||
|
||||
module.exports = {
|
||||
entry: ["./client/main.js"],
|
||||
output: {
|
||||
path: path.resolve(__dirname, "..", "server", "public"),
|
||||
publicPath: "/",
|
||||
filename: "[name].js",
|
||||
chunkFilename: "[chunkhash].js"
|
||||
},
|
||||
|
||||
module: {
|
||||
rules: [
|
||||
// это будет применяться к файлам `.js`
|
||||
// А ТАКЖЕ к секциям `<script>` внутри файлов `.vue`
|
||||
{
|
||||
test: /\.js$/,
|
||||
loader: 'babel-loader'
|
||||
},
|
||||
// это будет применяться к файлам `.css`
|
||||
// А ТАКЖЕ к секциям `<style>` внутри файлов `.vue`
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
'vue-style-loader',
|
||||
'css-loader'
|
||||
]
|
||||
},
|
||||
{
|
||||
test: /\.gif$/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
name: "images/[name]-[hash:6].[ext]",
|
||||
limit: 10000
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.png$/,
|
||||
loader: "url-loader",
|
||||
options: {
|
||||
name: "images/[name]-[hash:6].[ext]",
|
||||
limit: 10000
|
||||
}
|
||||
},
|
||||
{
|
||||
test: /\.jpg$/,
|
||||
loader: "file-loader",
|
||||
options: {
|
||||
name: "images/[name]-[hash:6].[ext]"
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
plugins: [
|
||||
new VueLoaderPlugin()
|
||||
]
|
||||
};
|
||||
Reference in New Issue
Block a user