Skip to content

Commit

Permalink
Merge pull request #7526 from sulkaharo/new_cache_location
Browse files Browse the repository at this point in the history
New build artefact cache location
  • Loading branch information
bewest committed Oct 1, 2022
2 parents a8da747 + aed9998 commit 8706658
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions lib/server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function create (env, ctx) {
}

// Production bundling
const tmpFiles = express.static(resolvePath('/tmp/public'), {
const tmpFiles = express.static(resolvePath('/node_modules/.cache/_ns_cache/public'), {
maxAge: maxAge
});

Expand All @@ -343,7 +343,7 @@ function create (env, ctx) {
, coffee_match: /coffeescript/
, json_match: /json/
, cssmin: myCssmin
, cache: resolvePath('/tmp/public')
, cache: resolvePath('/node_modules/.cache/_ns_cache/public')
, onerror: undefined
, }));

Expand Down
2 changes: 1 addition & 1 deletion lib/server/enclave.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const init = function init () {
let apiKeySet = false;

function readKey (filename) {
let filePath = path.resolve(__dirname + '/../../tmp/' + filename);
let filePath = path.resolve(__dirname + '/../../node_modules/.cache/_ns_cache/' + filename);
if (fs.existsSync(filePath)) {
return fs.readFileSync(filePath).toString().trim();
}
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
"test-single": "env-cmd -f ./my.test.env mocha --timeout 5000 --require ./tests/hooks.js --exit ./tests/$TEST.test.js",
"test-ci": "env-cmd -f ./tests/ci.test.env nyc --reporter=lcov --reporter=text-summary mocha --timeout 5000 --require ./tests/hooks.js --exit ./tests/*.test.js",
"env": "env",
"postinstall": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys",
"bundle": "webpack --mode production --config webpack/webpack.config.js && npm run-script generate-keys",
"bundle-dev": "webpack --mode development --config webpack/webpack.config.js && npm run-script generate-keys",
"postinstall": "webpack --mode production --config webpack/webpack.config.js && npm run-script post-generate-keys",
"bundle": "webpack --mode production --config webpack/webpack.config.js && npm run-script post-generate-keys",
"bundle-dev": "webpack --mode development --config webpack/webpack.config.js && npm run-script post-generate-keys",
"bundle-analyzer": "webpack --mode development --config webpack/webpack.config.js --profile --json > stats.json && webpack-bundle-analyzer stats.json",
"generate-keys": "node bin/generateRandomString.js >tmp/randomString",
"post-generate-keys": "node bin/generateRandomString.js >node_modules/.cache/_ns_cache/randomString",
"coverage": "cat ./coverage/lcov.info | env-cmd -f ./tests/ci.test.env codacy-coverage || echo NO COVERAGE",
"dev": "env-cmd -f ./my.env nodemon --inspect lib/server/server.js 0.0.0.0",
"dev-test": "env-cmd -f ./my.devtest.env nodemon --inspect lib/server/server.js 0.0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion tests/admintools.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('admintools', function ( ) {
before(function (done) {
benv.setup(function() {

benv.require(__dirname + '/../tmp/public/js/bundle.app.js');
benv.require(__dirname + '/../node_modules/.cache/_ns_cache/public/js/bundle.app.js');

self.$ = $;

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/headless.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function headless (benv, binding) {

console.log('Setting up benv', Date.now() - t);

benv.require(__dirname + '/../../tmp/public/js/bundle.app.js');
benv.require(__dirname + '/../../node_modules/.cache/_ns_cache/public/js/bundle.app.js');

console.log('Bundle loaded', Date.now() - t);

Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = {
clock: clockEntry
},
output: {
path: path.resolve(projectRoot, './tmp/public'),
path: path.resolve(projectRoot, './node_modules/.cache/_ns_cache/public'),
publicPath,
filename: 'js/bundle.[name].js',
sourceMapFilename: 'js/bundle.[name].js.map',
Expand Down

0 comments on commit 8706658

Please sign in to comment.