const path = require('path') const VueLoaderPlugin = require('vue-loader/lib/plugin') const projectName = 'projectmanage' module.exports = { entry: { singleSpaEntry: ['src/singleSpaEntry.js'] }, output: { filename: '[name].js', path: path.resolve(__dirname, 'dist'), libraryTarget: 'umd', library: 'projectmanage' }, module: { rules: [ { test: /\.vue$/, loader: 'vue-loader', options: { loaders: { js: 'babel-loader' } } }, { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/, include: path.join(__dirname, './src') }, { test: /\.(png|jpg|gif|svg)$/, loader: 'file-loader', options: { name: '[name].[ext]?[hash]', publicPath: `../${projectName}` } }, { test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000, name: 'fonts/[name].[hash:7].[ext]', publicPath: `../${projectName}` } }, { test: /\.css$/, use: ['vue-style-loader', 'css-loader'] }, { test: /\.scss$/, loaders: ['vue-style-loader', 'css-loader', 'sass-loader'] } ] }, resolve: { alias: { vue$: 'vue/dist/vue.esm.js', '@': path.join(__dirname, './src') }, extensions: ['.js', '.vue'], modules: [__dirname, 'node_modules'] }, mode: 'development', devtool: 'cheap-module-source-map', externals: [], plugins: [new VueLoaderPlugin()] }