Webpack
webpack
npm i -g webpack webpack-cli webpack-dev-server // bundle
npm i -D webpack // configconst path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
entry: {
modules: "./modules.js"
},
module: {},
resolve: {
extensions: ["*", ".js"] // 확장자를 생략할 수 있도록
},
output: {
filename: "[name].bundle.js", // bundle 될 파일 이름
path: path.resolve(__dirname, "dist"), // 위치
publicPath: "/"
},
devServer: {
contentBase: "./dist"
},
plugins: [
new HtmlWebpackPlugin({
title: "Development",
template: "./index.html",
filename: "./index.html",
showErrors: true // 에러 발생시 메세지가 브라우저 화면에 노출 된다.
})
]
};babel
css
html plugin
scripts
Last updated