Skip to content

Commit

Permalink
Remove complied JS from repo; compile JS when doing build
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed May 20, 2018
1 parent 55ed536 commit 090a4f6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 90 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ build
node_modules
wiki
amp.zip
**/*-compiled.js
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ module.exports = function( grunt ) {
versionAppend = commitHash + '-' + new Date().toISOString().replace( /\.\d+/, '' ).replace( /-|:/g, '' );

paths = lsOutput.trim().split( /\n/ ).filter( function( file ) {
return ! /^(\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*)/.test( file );
return ! /^(blocks|\.|bin|([^/]+)+\.(md|json|xml)|Gruntfile\.js|tests|wp-assets|dev-lib|readme\.md|composer\..*)/.test( file );
} );
paths.push( 'vendor/autoload.php' );
paths.push( 'assets/js/*-compiled.js' );
paths.push( 'vendor/composer/**' );
paths.push( 'vendor/sabberworm/php-css-parser/lib/**' );

Expand Down
88 changes: 0 additions & 88 deletions assets/js/amp-blocks-compiled.js

This file was deleted.

4 changes: 4 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ To install the `pre-commit` hook, do `bash dev-lib/install-pre-commit-hook.sh`.

Note that pull requests will be checked against [WordPress-Coding-Standards](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards) with PHPCS, and for JavaScript linting is done with ESLint and (for now) JSCS and JSHint.

## Modifying JavaScript for Blocks

To edit JavaScript code which is built/complied, run `npm run dev` to watch the files which Webpack will build. These complied files are excluded from version control but they are included in the release packages.

## Creating a Plugin Build

To create a build of the plugin for installing in WordPress as a ZIP package, do:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"main": "blocks/index.js",
"scripts": {
"build": "grunt build",
"build": "cross-env BABEL_ENV=default webpack; grunt build",
"deploy": "grunt deploy",
"dev": "cross-env BABEL_ENV=default webpack --watch"
}
Expand Down

0 comments on commit 090a4f6

Please sign in to comment.