Skip to content

Instantly share code, notes, and snippets.

@kasterra
Last active October 11, 2022 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasterra/f0b3ac69b77ecde461fb2a61b1bded93 to your computer and use it in GitHub Desktop.
Save kasterra/f0b3ac69b77ecde461fb2a61b1bded93 to your computer and use it in GitHub Desktop.
Lit로 돌아가는 SPA의 webpack.prod.js 웹팩 설정(배포용)
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'production',
entry: {
bundle: './src/client/index.ts',
elements: './src/client/global/allComponents.ts',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, '../dist/static'),
publicPath: `/static`,
clean: true,
},
module: {
rules: [
{
test: /\.ts$/,
use: [
{
loader: 'ts-loader',
options: {
compilerOptions: {
target: 'es6',
moduleResolution: 'node',
},
},
},
],
},
{
test: /\.scss$/,
use: [
'lit-css-loader',
{
loader: 'sass-loader',
options: {
sassOptions: {
outputStyle: 'compressed',
},
},
},
],
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/client/index.html',
chunks: ['bundle'],
}),
],
experiments: {
topLevelAwait: true,
},
resolve: {
extensions: ['.ts'],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment