Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New build artefact cache location #7526

Merged
merged 8 commits into from
Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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