Last active
October 11, 2022 11:37
-
-
Save kasterra/afee218b61cbb09d4761870fdfbac936 to your computer and use it in GitHub Desktop.
Lit로 돌아가는 SPA의 webpack.dev.js 웹팩 설정(개발용)
This file contains hidden or 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: 'development', | |
entry: { | |
bundle: './src/client/index.ts', | |
elements: './src/client/global/allComponents.ts', | |
}, | |
output: { | |
filename: '[name].js', | |
path: path.resolve(__dirname, '../dist/static'), | |
publicPath: `${process.env.ADDR}/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: { sourceMap: true } }, | |
], | |
}, | |
], | |
}, | |
plugins: [ | |
new HtmlWebpackPlugin({ | |
template: 'src/client/index.html', | |
chunks: ['bundle'], | |
}), | |
], | |
experiments: { | |
topLevelAwait: true, | |
}, | |
devtool: 'source-map', | |
resolve: { | |
extensions: ['.ts'], | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment