Skip to content

Commit

Permalink
(refactor): move build configs into test/build-config/
Browse files Browse the repository at this point in the history
- having the build configs in app root made it kind of seem like they
  were being used to produce the library's export, but they're solely
  used for testing purposes
  - so moving them into test/ seems to make sense to me

- also to declutter app root similar to previous commits

- use process.cwd() in webpack config as __dirname is no longer app
  root, but process.cwd() still is as it's still called from
  package.json scripts
  • Loading branch information
agilgur5 committed Nov 25, 2019
1 parent f1378c0 commit 41a9963
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"test": "npm run clean && npm run browserify && npm run webpack && ava",
"test:browserify": "npm run browserify && ava test/browserify.spec.js",
"test:webpack": "npm run webpack && ava test/webpack.spec.js",
"browserify": "node browserify.config.js",
"webpack": "webpack",
"browserify": "node test/build-config/_browserify.config.js",
"webpack": "webpack --config test/build-config/_webpack.config.js",
"clean": "rm -rf build/ && mkdir build/"
},
"ava": {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions webpack.config.js → test/build-config/_webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path')
module.exports = {
entry: './test/utils/webpack/_export-to-window.js',
output: {
path: path.join(__dirname, '/build/'),
path: path.join(process.cwd(), '/build/'),
filename: 'webpack.bundle.js',
library: 'Physijs',
libraryTarget: 'umd'
Expand All @@ -14,6 +14,6 @@ module.exports = {
externals: /^three$/,
// don't parse ammo
module: {
noParse: path.join(__dirname, '/vendor/ammo.js')
noParse: path.join(process.cwd(), '/vendor/ammo.js')
}
}

0 comments on commit 41a9963

Please sign in to comment.