webpack.config.js 684 B

123456789101112131415161718192021222324
  1. const path = require('path');
  2. const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  3. module.exports = {
  4. entry: './wwwroot/lib/index.js',
  5. output: {
  6. filename: 'bundle.js',
  7. path: path.resolve(__dirname, 'wwwroot/js')
  8. },
  9. mode: 'production', // live : production, develop : 'development'
  10. module: {
  11. rules: [
  12. {
  13. test: /\.css$/, // CSS 파일에 대한 규칙
  14. use: [MiniCssExtractPlugin.loader, 'css-loader'], // CSS를 별도 파일로 추출
  15. }
  16. ]
  17. },
  18. plugins: [
  19. new MiniCssExtractPlugin({
  20. filename: '../css/bundle.css',
  21. }),
  22. ]
  23. };