Skip to content

Commit 714ef55

Browse files
emeaguiarravichdev
authored andcommitted
Merge pull request #18 from material-components/feature/543-build
Update build to ignore map files and include unminified files for theme
2 parents dd069aa + b0a662a commit 714ef55

File tree

7 files changed

+55
-15
lines changed

7 files changed

+55
-15
lines changed

Gruntfile.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ module.exports = function( grunt ) {
3131
'!plugin/**/._.DS_Store',
3232
'!plugin/**/.DS_Store',
3333
'!plugin/assets/css/src/**',
34+
'!plugin/assets/css/*.map',
3435
'!plugin/assets/js/.gitignore',
36+
'!plugin/assets/js/*.css',
37+
'!plugin/assets/js/*.map',
3538
'!plugin/assets/src/**',
3639
'!plugin/assets/images/png/**',
3740
'!plugin/assets/images/jpg/**',
@@ -81,6 +84,7 @@ module.exports = function( grunt ) {
8184
'!theme/assets/js/.gitignore',
8285
'!theme/assets/js/*.php',
8386
'!theme/assets/js/*.map',
87+
'!theme/assets/js/editor*',
8488
'!theme/assets/src/**',
8589
'!theme/tests/**',
8690
'!theme/wp-assets/**',
@@ -194,6 +198,7 @@ module.exports = function( grunt ) {
194198
const iconArray = item.split( /\s/g );
195199

196200
icons.icons[ iconArray[ 1 ] ] = {
201+
id: iconArray[ 1 ],
197202
name: iconArray[ 0 ],
198203
};
199204
} );
@@ -208,7 +213,7 @@ module.exports = function( grunt ) {
208213

209214
grunt.registerTask( 'readme', [ 'shell:readme' ] );
210215

211-
grunt.registerTask( 'build', [ 'readme', 'copy', 'icon_mapping' ] );
216+
grunt.registerTask( 'build', [ 'readme', 'icon_mapping', 'copy' ] );
212217

213218
grunt.registerTask( 'create-build-zip', [
214219
'shell:create_plugin_zip',

package-lock.json

Lines changed: 35 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
"devDependencies": {
2626
"@babel/cli": "7.8.4",
2727
"@babel/core": "7.8.4",
28-
"@babel/preset-env": "7.11.5",
2928
"@babel/plugin-proposal-optional-chaining": "7.8.3",
3029
"@babel/plugin-transform-react-jsx": "7.8.3",
30+
"@babel/preset-env": "7.11.5",
3131
"@material/button": "5.1.0",
3232
"@material/card": "5.1.0",
3333
"@material/checkbox": "5.1.0",
@@ -44,8 +44,8 @@
4444
"@material/switch": "6.0.0",
4545
"@material/tab-bar": "5.1.0",
4646
"@material/textfield": "5.1.0",
47-
"@material/top-app-bar": "5.1.0",
4847
"@material/tooltip": "8.0.0",
48+
"@material/top-app-bar": "5.1.0",
4949
"@material/typography": "5.1.0",
5050
"@sheerun/mutationobserver-shim": "0.3.3",
5151
"@testing-library/dom": "7.2.2",
@@ -123,7 +123,7 @@
123123
"postcss-import": "12.0.1",
124124
"postcss-loader": "3.0.0",
125125
"postcss-mixins": "6.2.3",
126-
"postcss-nested": "4.2.1",
126+
"postcss-nested": "4.2.3",
127127
"postcss-preset-env": "6.7.0",
128128
"postcss-simple-vars": "5.0.2",
129129
"prettier": "npm:[email protected]",
@@ -148,7 +148,7 @@
148148
"scripts": {
149149
"build": "npm-run-all build:*",
150150
"build:prepare": "grunt clean",
151-
"build:js": "wp-scripts build",
151+
"build:js": "NODE_ENV=dev wp-scripts build && wp-scripts build",
152152
"build:run": "grunt build",
153153
"build:zip": "grunt create-build-zip",
154154
"deploy": "npm run build && grunt deploy",

plugin/assets/fonts/icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

postcss.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ module.exports = {
8585
stage: 0,
8686
preserve: false, // Omit pre-polyfilled CSS.
8787
features: {
88-
'nesting-rules': false, // Uses postcss-nesting which doesn't behave like Sass.
88+
'nesting-rules': true, // Uses postcss-nesting which doesn't behave like Sass.
8989
'custom-properties': {
9090
preserve: true, // Do not remove :root selector.
9191
},
92+
'custom-media-queries': true,
9293
},
9394
autoprefixer: {
9495
grid: true,

theme/assets/css/src/components/top-app-bar.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
& .mdc-top-app-bar__action-item,
2323
& .mdc-top-app-bar__navigation-icon {
2424
color: var(--mdc-theme-on-header, var(--mdc-theme-on-primary, #fff));
25+
26+
&:hover,
27+
&:focus,
28+
&:visited {
29+
color: var(--mdc-theme-on-header, var(--mdc-theme-on-primary, #fff));
30+
}
2531
}
2632

2733
& .mdc-top-app-bar__section--align-start {

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ const getSharedConfig = packageType => {
204204
// Remove the CleanWebpackPlugin and FixStyleWebpackPlugin plugins from `@wordpress/scripts` due to version conflicts.
205205
...defaultConfig.plugins.filter(
206206
plugin =>
207+
packageType === 'plugin' &&
207208
! [ 'CleanWebpackPlugin', 'FixStyleWebpackPlugin' ].includes(
208209
plugin.constructor.name
209210
)

0 commit comments

Comments
 (0)