家政小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.dev.config.js 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const webpack = require('webpack');
  2. const HtmlWebpackPlugin = require('html-webpack-plugin');
  3. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  4. const CopyWebpackPlugin = require('copy-webpack-plugin');
  5. const merge = require('webpack-merge');
  6. const webpackBaseConfig = require('./webpack.base.config.js');
  7. const fs = require('fs');
  8. const package = require('../package.json');
  9. fs.open('./build/env.js', 'w', function(err, fd) {
  10. const buf = Buffer.from('export default "development";');
  11. fs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer) {});
  12. });
  13. module.exports = merge(webpackBaseConfig, {
  14. devtool: '#source-map',
  15. output: {
  16. publicPath: '/dist/',
  17. filename: '[name].js',
  18. chunkFilename: '[name].chunk.js'
  19. },
  20. plugins: [
  21. new ExtractTextPlugin({
  22. filename: '[name].css',
  23. allChunks: true
  24. }),
  25. new webpack.optimize.CommonsChunkPlugin({
  26. name: ['vender-exten', 'vender-base'],
  27. minChunks: Infinity
  28. }),
  29. new HtmlWebpackPlugin({
  30. title: '家政后台',
  31. filename: '../index.html',
  32. template: './src/template/index.ejs',
  33. inject: false
  34. }),
  35. new CopyWebpackPlugin([
  36. {
  37. from: 'src/views/main-components/theme-switch/theme'
  38. },
  39. {
  40. from: 'src/views/my-components/text-editor/tinymce'
  41. }
  42. ], {
  43. ignore: [
  44. 'text-editor.vue'
  45. ]
  46. })
  47. ]
  48. });