Skip to content

Run Sidecar with Webpack

Terminal window
npm install webpack-hook-plugin @spotlightjs/spotlight --save-dev
webpack.config.js
const path = require("path");
const WebpackHookPlugin = require("webpack-hook-plugin");
module.exports = {
watch: true,
devServer: {
static: {
directory: path.join(__dirname, "dist"),
},
compress: true,
port: 9000,
},
entry: "./src/index.js",
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist"),
},
plugins: [
new WebpackHookPlugin({
onBuildStart: ['npx @spotlightjs/spotlight'],
// Or you package manager of you choice e.g. yarn run spotlight-sidecar
}),
],
};