Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use webpack-config with wp-scritps #6

Merged
merged 13 commits into from
Feb 21, 2019

Conversation

oandregal
Copy link
Owner

@oandregal oandregal commented Feb 18, 2019

This uses webpack-config package with @wordpress/scripts. It requires that this plugin:

  • Install necessary packages: npm install --save-dev --save-exact <path-to-local-scripts-package>
  • Entry should be at src/index.js. Output will be at build/index.js

Note that current webpack-config setup doesn't support JSX.

@gziolo
Copy link

gziolo commented Feb 18, 2019

Entry should be at src/index.js. Output will be at dist/main.js

I added logic which changes the output to build/index.js to follow the pattern used inside Gutenberg.

@oandregal oandregal merged commit 503e934 into master Feb 21, 2019
@oandregal oandregal deleted the add/webpack-config-with-scripts branch February 21, 2019 10:23
@@ -0,0 +1,3 @@
const config = require( '@wordpress/scripts/config/webpack.config.js' );
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next step, get rid of this file altogether :)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

icon: 'heart',
category: 'common',
edit: function() {
return ( createElement(
Copy link

@gziolo gziolo Feb 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 2, start using JSX in here without having to import createElement explicitly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants