Files
liberama/build/webpack.base.config.js
2018-12-28 19:05:08 +07:00

52 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const path = require("path");
const webpack = require("webpack");
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
entry: [path.resolve(__dirname, "../client/main.js")],
output: {
path: path.resolve(__dirname, "../server/public/app"),
publicPath: "/app",
filename: "bundle.js"
},
module: {
rules: [
// это будет применяться к файлам `.js`
// А ТАКЖЕ к секциям `<script>` внутри файлов `.vue`
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
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()
]
};