I am currently experimenting with monorepo architecture.
What I would like to do is in my web package, where I start the webpack dev server. I would like it to look at specific node_modules (symbolic local packages) for changes and run "rebuild".
This way, I can create dependencies separately, and my browser will respond to these changes.
The configuration of my webpack is as follows:
var loaders = require('./../../../build/loaders-default'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var path = require('path'); var webpack = require('webpack'); module.exports = { entry: ['./src/index.ts'], output: { filename: 'build.js', path: path.join(__dirname, 'dist') }, resolve: { extensions: ['.ts', '.js', '.json'] }, resolveLoader: { modules: ['node_modules'] }, devtool: 'inline-source-map', devServer: { proxy: [ { context: ['/api-v1/**', '/api-v2/**'], target: 'https://other-server.example.com', secure: false } ] }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', inject: 'body', hash: true }), new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', 'window.jquery': 'jquery' }) ], module:{ loaders: loaders } };
Loaders are just common stuff.
source share