项目原始demo,不改动
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Это архивный репозиторий. Вы можете его клонировать или просматривать файлы, но не вносить изменения или открывать задачи/запросы на слияние.

4 лет назад
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. const path = require('path')
  2. const ExtractTextPlugin = require('extract-text-webpack-plugin')
  3. const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
  4. const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
  5. module.exports = {
  6. entry: './src/index.js',
  7. output: {
  8. filename: 'vue-selectl.js',
  9. path: path.resolve(__dirname, 'dist'),
  10. library: 'VueSelectl',
  11. libraryTarget: 'umd',
  12. umdNamedDefine: true
  13. },
  14. resolve: {
  15. extensions: ['.js', '.vue', '.styl'],
  16. alias: {
  17. 'vue$': 'vue/dist/vue.esm.js'
  18. }
  19. },
  20. module: {
  21. rules: [
  22. {
  23. test: /\.vue$/,
  24. loader: 'vue-loader',
  25. options: {
  26. extractCSS: true
  27. }
  28. },
  29. {
  30. test: /\.js$/,
  31. loader: 'babel-loader',
  32. exclude: /node_modules/
  33. },
  34. {
  35. test: /\.(styl|css)$/,
  36. loader: ExtractTextPlugin.extract({
  37. fallback: 'style-loader',
  38. use: [
  39. {
  40. loader: 'css-loader',
  41. options: {
  42. minimize: true
  43. }
  44. },
  45. 'stylus-loader'
  46. ]})
  47. },
  48. {
  49. test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
  50. loader: 'url-loader',
  51. options: {
  52. limit: 10000,
  53. name: '[name].[ext]'
  54. }
  55. },
  56. {
  57. test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
  58. use: [
  59. {
  60. loader: 'url-loader',
  61. options: {
  62. limit: 10000,
  63. name: '[name].[ext]'
  64. }
  65. }
  66. ]
  67. }
  68. ]
  69. },
  70. externals: {
  71. vue: 'vue'
  72. },
  73. plugins: [
  74. new ExtractTextPlugin('styles.css'),
  75. new UglifyJSPlugin({
  76. uglifyOptions: {
  77. compress: {
  78. warnings: false,
  79. drop_console: true,
  80. drop_debugger: false
  81. }
  82. }
  83. }),
  84. new OptimizeCssAssetsPlugin({
  85. assetNameRegExp: /\.css$/g,
  86. cssProcessor: require('cssnano'),
  87. cssProcessorOptions: { discardComments: { removeAll: true } },
  88. canPrint: true
  89. })
  90. ]
  91. }