|
@@ -1,113 +0,0 @@
|
|
|
-
|
|
|
-const path = require('path')
|
|
|
-const ip = require('ip')
|
|
|
-const webpack = require('webpack')
|
|
|
-const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
-const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
|
-const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin')
|
|
|
-const config = require('../config')
|
|
|
-const clientOptions = '?path=/__what&timeout=5000&reload=true&quiet=true'
|
|
|
-const VueLoaderPlugin = require('vue-loader/lib/plugin')
|
|
|
-
|
|
|
-module.exports = {
|
|
|
- mode: 'development',
|
|
|
- entry: [
|
|
|
- `webpack-hot-middleware/client${clientOptions}`,
|
|
|
- path.resolve(__dirname, '../../src/index.js'),
|
|
|
- ],
|
|
|
- output: {
|
|
|
- filename: 'bundle.js',
|
|
|
- publicPath: config.dev.publicPath,
|
|
|
- },
|
|
|
- module: {
|
|
|
- rules: [
|
|
|
- {
|
|
|
- test: /\.css$/i,
|
|
|
- use: [
|
|
|
- 'style-loader',
|
|
|
- {
|
|
|
- loader: 'css-loader',
|
|
|
- options: {
|
|
|
- importLoaders: 1,
|
|
|
- },
|
|
|
- },
|
|
|
- 'postcss-loader',
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.s[ac]ss$/i,
|
|
|
- use: [
|
|
|
- 'style-loader',
|
|
|
- {
|
|
|
- loader: 'css-loader',
|
|
|
- options: {
|
|
|
- importLoaders: 2,
|
|
|
- },
|
|
|
- },
|
|
|
- 'postcss-loader',
|
|
|
- 'sass-loader',
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.(png|jpe?g|gif|svg)$/i,
|
|
|
- loader: 'file-loader',
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.(ttf|otf|woff2?|eot)$/i,
|
|
|
- loader: 'file-loader',
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.js$/,
|
|
|
- enforce: 'pre',
|
|
|
- exclude: /node_modules/,
|
|
|
- loader: 'eslint-loader',
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.js$/,
|
|
|
- exclude: /node_modules/,
|
|
|
- loader: 'babel-loader',
|
|
|
- },
|
|
|
- {
|
|
|
- test: /\.vue$/,
|
|
|
- loader: 'vue-loader',
|
|
|
- },
|
|
|
- ],
|
|
|
- },
|
|
|
- externals: {
|
|
|
- vue: 'Vue',
|
|
|
- },
|
|
|
- resolve: {
|
|
|
- extensions: [
|
|
|
- '.js',
|
|
|
- '.vue',
|
|
|
- ],
|
|
|
- alias: {
|
|
|
- '@': path.resolve(__dirname, '../../src'),
|
|
|
- },
|
|
|
- },
|
|
|
- devtool: 'inline-source-map',
|
|
|
- plugins: [
|
|
|
- new HtmlWebpackPlugin({
|
|
|
- template: config.template,
|
|
|
- }),
|
|
|
- new VueLoaderPlugin(),
|
|
|
- new webpack.DefinePlugin({
|
|
|
- 'process.env': config.dev.env,
|
|
|
- }),
|
|
|
- new webpack.HotModuleReplacementPlugin(),
|
|
|
- new FriendlyErrorsWebpackPlugin({
|
|
|
- compilationSuccessInfo: {
|
|
|
- messages: [
|
|
|
- `http://localhost:${config.port} or http://${ip.address()}:${config.port}`,
|
|
|
- ],
|
|
|
- },
|
|
|
- }),
|
|
|
- new CopyWebpackPlugin([
|
|
|
- {
|
|
|
- from: path.resolve(__dirname, '../../static'),
|
|
|
- to: 'static',
|
|
|
- ignore: ['.*'],
|
|
|
- },
|
|
|
- ]),
|
|
|
- ],
|
|
|
-}
|