webpack.config.js 579 B

123456789101112131415161718192021222324
  1. var path = require('path');
  2. const DEMO_PATH = './demo';
  3. const STATIC_JS = 'js';
  4. const PUBLIC_PATH = './' + STATIC_JS + '/';
  5. module.exports = [
  6. {
  7. mode: 'production',
  8. entry: {
  9. 'test': ['./src/test.js']
  10. },
  11. output: {
  12. path: path.join(__dirname, DEMO_PATH, STATIC_JS),
  13. publicPath: PUBLIC_PATH,
  14. filename: '[name].js',
  15. chunkFilename: '[name].[chunkhash].js',
  16. },
  17. resolve: {
  18. extensions: ['.js']
  19. },
  20. module: {
  21. rules: []
  22. }
  23. }
  24. ];