const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') }, mo... ...
const path = require('path'); module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: path.resolve(__dirname, 'dist') }, module: { rules:[ // css載入 //包下載命令:npm install --save-dev style-loader css-loader { test:/\.css$/, use:[ 'style-loader', 'css-loader', ] }, // 圖片載入及字體載入 //包下載命令:npm install --save-dev file-loader { test:/\.(png|jpg|gif)$/, use:[ 'file-loader' ] }, { test:/\.(woff|woff2|eot|ttf|otf)$/, use:[ 'file-loader' ] }, // 數據載入 (json是內置的,所以無需下載對應的包) //包命令:npm install --save-dev csv-loader xml-loader { test:/\.xml$/, use:[ 'xml-loader' ] }, { test:/\.(csv|tsv)$/, use:[ 'csv-loader' ] } ] } };