/
aurora
/
test
Обзор
Документация
Войти
/
aurora
/
test
Код
Запросы
1
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
05_week/solution/webpack.config.js
48 строк
1 KB
auroraptor
WIP
14 июл 2024, 17:55
14 июл 2024, 17:55
0e476ff
Код
Авторство
О чём код?
const path = require('path'); const HTMLWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const LoadExternalUrlsPlugin = require('./plugins/loadExternalUrlsPlugin'); const urls = require('./src/urls'); module.exports = { experiments: { outputModule: true, }, context: path.resolve(__dirname, 'src'), mode: 'production', entry: './index.js', output: { filename: '[name].[contenthash].js', path: path.resolve(__dirname, 'dist'), clean: true, }, resolve: { extensions: ['.js', '.json', '.jpg', '.css'], }, devServer: { port: 8080, }, plugins: [ new CopyWebpackPlugin({ patterns: [ { from: path.resolve(__dirname, 'src', 'assets'), to: 'public' }, ], }), new HTMLWebpackPlugin({ template: './index.html', }), new LoadExternalUrlsPlugin({ urls }), ], module: { rules: [ { test: /\.(scss|css)$/, use: ['style-loader', 'css-loader'], }, { test: /\.(png|svg|jpg|jpeg|webp|json)$/i, type: 'asset/resource', }, ], }, };