mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
|
|
import path from 'node:path'
|
||
|
|
import { fileURLToPath } from 'node:url'
|
||
|
|
|
||
|
|
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
||
|
|
|
||
|
|
const root = path.dirname(fileURLToPath(import.meta.url))
|
||
|
|
|
||
|
|
export default {
|
||
|
|
entry: './src/main.js',
|
||
|
|
output: {
|
||
|
|
path: path.join(root, 'dist'),
|
||
|
|
filename: 'assets/app.[contenthash].js',
|
||
|
|
assetModuleFilename: 'assets/[name].[contenthash][ext]',
|
||
|
|
clean: true,
|
||
|
|
},
|
||
|
|
resolve: {
|
||
|
|
extensions: ['.svelte', '.js'],
|
||
|
|
conditionNames: ['svelte', 'browser', '...'],
|
||
|
|
mainFields: ['svelte', 'browser', 'module', 'main'],
|
||
|
|
},
|
||
|
|
module: {
|
||
|
|
rules: [
|
||
|
|
{
|
||
|
|
test: /\.svelte$/,
|
||
|
|
use: {
|
||
|
|
loader: 'svelte-loader',
|
||
|
|
options: {
|
||
|
|
emitCss: false,
|
||
|
|
hotReload: false,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
plugins: [
|
||
|
|
new HtmlWebpackPlugin({
|
||
|
|
templateContent: '<!doctype html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Svelte Webpack sprite fixture</title></head><body><div id="app"></div></body></html>',
|
||
|
|
}),
|
||
|
|
],
|
||
|
|
}
|