Skip to content

Commit 5cdfb64

Browse files
author
Paul Dechov
committed
Use package config for npm variables, for npm 7+
1 parent 4729b3d commit 5cdfb64

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

package.json

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,18 @@
116116
"i18n:merge": "php bin/update-pot-file-references.php languages/woocommerce-gateway-stripe.pot",
117117
"start": "npm run start:webpack",
118118
"start:webpack": "rimraf build/* && wp-scripts start",
119-
"preuglify": "rm -f $npm_package_assets_js_min",
120-
"uglify": "for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
119+
"preuglify": "rm -f $npm_package_config_assets_js_min",
120+
"uglify": "for f in $npm_package_config_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done",
121121
"up": "docker-compose up --build --force-recreate -d && ./bin/docker-setup.sh",
122122
"down": "docker-compose down",
123123
"xdebug:start": "docker-compose exec wordpress sh -c 'sed -i \"/xdebug.mode=off/c\\xdebug.mode=debug\" /usr/local/etc/php/php.ini && /etc/init.d/apache2 reload'",
124124
"xdebug:stop": "docker-compose exec wordpress sh -c 'sed -i \"/xdebug.mode=debug/c\\xdebug.mode=off\" /usr/local/etc/php/php.ini && /etc/init.d/apache2 reload'",
125125
"wp": "docker run -it --env-file default.env --rm --user xfs --volumes-from woocommerce_stripe_wordpress --network container:woocommerce_stripe_wordpress wordpress:cli",
126126
"listen": "stripe listen --forward-to 'http://localhost:8082/?wc-api=wc_stripe'",
127-
"presass": "rm -f $npm_package_assets_styles_css",
128-
"sass": "node_modules/.bin/node-sass $npm_package_assets_styles_cssfolder --output $npm_package_assets_styles_cssfolder --output-style compressed",
129-
"watchsass": "node_modules/.bin/node-sass $npm_package_assets_styles_sass --output $npm_package_assets_styles_cssfolder --output-style compressed --watch",
130-
"postsass": "for f in $npm_package_assets_styles_css; do file=${f%.css}; node_modules/.bin/cleancss -o $file.css $f; done",
127+
"presass": "rm -f $npm_package_config_assets_styles_css",
128+
"sass": "node_modules/.bin/node-sass $npm_package_config_assets_styles_cssfolder --output $npm_package_config_assets_styles_cssfolder --output-style compressed",
129+
"watchsass": "node_modules/.bin/node-sass $npm_package_config_assets_styles_sass --output $npm_package_config_assets_styles_cssfolder --output-style compressed --watch",
130+
"postsass": "for f in $npm_package_config_assets_styles_css; do file=${f%.css}; node_modules/.bin/cleancss -o $file.css $f; done",
131131
"test": "cross-env NODE_CONFIG_DIR='./tests/e2e/config' BABEL_ENV=commonjs mocha \"tests/e2e\" --require babel-register --recursive",
132132
"test:grep": "cross-env NODE_CONFIG_DIR='./tests/e2e/config' BABEL_ENV=commonjs mocha \"tests/e2e\" --require babel-register --grep ",
133133
"test:single": "cross-env NODE_CONFIG_DIR='./tests/e2e/config' BABEL_ENV=commonjs mocha --require babel-register",
@@ -159,6 +159,17 @@
159159
"includes",
160160
"templates",
161161
"woocommerce-gateway-stripe.php"
162-
]
162+
],
163+
"assets": {
164+
"js": {
165+
"min": "assets/js/*.min.js",
166+
"js": "assets/js/*.js"
167+
},
168+
"styles": {
169+
"css": "assets/css/*.css",
170+
"sass": "assets/css/*.scss",
171+
"cssfolder": "assets/css/"
172+
}
173+
}
163174
}
164175
}

0 commit comments

Comments
 (0)