ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.15k stars 328 forks source link

Failed to compile. Entry module not found: Error: Can't resolve 'babel-loader' ... #261

Open skytonnessen opened 4 years ago

skytonnessen commented 4 years ago

Just started with this in the wp-content/plugins directory: npx create-guten-block my-block cd my-block npm start

Immediately after running npm start, I get the error: ❌ Failed to compile. 👉 Entry module not found: Error: Can't resolve 'babel-loader' in '/Users/sky/Documents/1-Wordpress/Sandbox/wordpress/wp-content/plugins/my-block'

My version of node is v10.16.0 and npm is 6.9.0.

skytonnessen commented 4 years ago

I think I have it running by adding these lines to the node_modules/cgb-scripts/config/ webpack.config.dev.js and webpack.config.prod.js: (at line 84 on the dev and 88 on the prod after output: { // Add /* filename */ comments to generated require()s in the output. pathinfo: true, // The dist folder. path: paths.pluginDist, filename: '[name].js', // [name] = './dist/blocks.build' as defined above. },) I added: resolveLoader: { modules: ['node_modules/cgb-scripts/node_modules'], }, resolve: { modules: ['node_modules/cgb-scripts/node_modules'], },