Answer the question
In order to leave comments, you need to log in
How to combine multiple js files into one webpack?
I use this config:
const path = require('path');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = {
mode: 'development',
entry: [
'./node_modules/vue-router/dist/vue-router.global.js',
'./node_modules/http-vue-loader/src/httpVueLoader.js',
'./node_modules/vue/dist/vue.common.prod.js',
],
devtool: 'source-map',
output: {
filename:'bundle.js',
path: __dirname + '/js'
},
optimization: {
minimizer: [
new UglifyJsPlugin({
include: /\.js$/
}),
],
},
};
<!-- <script src="node_modules/vue/dist/vue.js"></script>-->
<!-- <script src="node_modules/vue-router/dist/vue-router.global.js"></script>-->
<!-- <script src="node_modules/http-vue-loader/src/httpVueLoader.js"></script>-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- <script src="node_modules/vue/dist/vue.js"></script>-->
<!-- <script src="node_modules/vue-router/dist/vue-router.global.js"></script>-->
<!-- <script src="node_modules/http-vue-loader/src/httpVueLoader.js"></script>-->
<script src='js/bundle.js'></script>
</head>
<body>
<div id="app">
<h1>Passing Route Parameters to Component Props</h1>
</div>
<script src='js/index.js'></script>
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question