webpack.js.org icon indicating copy to clipboard operation
webpack.js.org copied to clipboard

How to write loader with HMR

Open linlinyang opened this issue 5 years ago • 2 comments

when develop a loader, How I develop it in my demo with HMR. resolveLoader: { alias: { 'my-loader': require.resolve('../lib/index.js') } }, I modify my loader files ../lib/index.js, demo do not update

linlinyang avatar Jul 10 '20 06:07 linlinyang

I think we should improve docs and provide example how to write a simple loader/plugin (I think most popular is working with assets)

alexander-akait avatar Jul 10 '20 11:07 alexander-akait

@evilebottnawi I read the loader api and try to write it, but it‘'s inconvenient when id develop it. Cannot get the loader result immediate

linlinyang avatar Jul 10 '20 13:07 linlinyang