Last active
October 11, 2022 11:37
-
-
Save kasterra/f0b3ac69b77ecde461fb2a61b1bded93 to your computer and use it in GitHub Desktop.
Lit로 돌아가는 SPA의 webpack.prod.js 웹팩 설정(배포용)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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