Merge pull request #2265 from overleaf/as-move-vendored-deps

Move vendored dependencies out of output directory

GitOrigin-RevId: bad086bdc2a80f9df5d3f934098cb7b05e8f6db5
This commit is contained in:
Alasdair Smith 2019-10-30 11:19:44 +00:00 committed by sharelatex
parent 4f637f14b5
commit 78c30015f4
668 changed files with 78 additions and 94 deletions

View file

@ -1,5 +1,4 @@
node_modules
modules/**/scripts
public/js
public/src/vendor
public/minjs
modules/**/public/js

View file

@ -1,5 +1,4 @@
node_modules
modules/**/scripts
public/js
public/src/vendor
public/minjs
modules/**/public/js

View file

@ -1053,7 +1053,11 @@ var defaultSettingsForAnonymousUser = userId => ({
var THEME_LIST = []
function generateThemeList() {
const files = fs.readdirSync(
Path.join(__dirname, '/../../../../public/js/', PackageVersions.lib('ace'))
Path.join(
__dirname,
'/../../../../public/src/vendor/',
PackageVersions.lib('ace')
)
)
const result = []
for (let file of files) {

View file

@ -145,8 +145,11 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) {
res.locals.buildJsPath = function(jsFile, opts = {}) {
// Resolve path from webpack manifest file
let path = webpackManifest[jsFile]
// If not found in manifest, it is directly linked, so fallback to
// relevant public directory
// HACK: If file can't be found within the webpack manifest, force url
// to be relative to JS asset directory.
// This should never happen in production, but it can happen in local
// testing if webpack hasn't compiled
if (!path) {
path = Path.join(jsPath, jsFile)
}
@ -162,6 +165,10 @@ module.exports = function(webRouter, privateApiRouter, publicApiRouter) {
return path
}
res.locals.buildAssetsPath = function(path) {
return `${jsPath}/${path}`
}
res.locals.mathJaxPath = res.locals.buildJsPath('libs/mathjax/MathJax.js', {
cdn: false,
qs: { config: 'TeX-AMS_HTML,Safe' }

View file

@ -137,9 +137,9 @@ block content
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
window.gitBridgePublicBaseUrl = '#{gitBridgePublicBaseUrl}'
//- Set base path for Ace scripts loaded on demand/workers and don't use cdn
window.aceBasePath = "#{buildJsPath(lib('ace'), {cdn:false})}"
window.aceBasePath = "#{buildAssetsPath(lib('ace'))}"
//- Set path for PDFjs CMaps
window.pdfCMapsPath = "#{buildJsPath('cmaps/', {cdn: false})}"
window.pdfCMapsPath = "#{buildAssetsPath('cmaps/')}"
window.uiConfig = JSON.parse('!{StringHelper.stringifyJsonForScript(uiConfig)}');
//- enable doc hash checking for all projects
//- used in public/js/libs/sharejs.js

View file

@ -15,18 +15,17 @@ module.exports = function(config) {
files: [
'test/unit_frontend/bootstrap.js',
// Include scripts that are injected into the page outside of webpack
'public/js/libs/angular-1.6.4.min.js',
'public/js/libs/jquery-1.11.1.min.js',
'public/src/vendor/libs/angular-1.6.4.min.js',
'public/src/vendor/libs/jquery-1.11.1.min.js',
// Allow mocking of angular
'public/js/libs/angular-mocks.js',
'public/src/vendor/libs/angular-mocks.js',
// Import all tests (see comment in the file for why this is necessary)
'test/unit_frontend/import_tests.js',
// Include CSS (there is some in js/libs dir)
'public/stylesheets/**/*.css',
'public/js/libs/**/*.css'
// Include CSS
'public/stylesheets/**/*.css'
],
middleware: ['fake-img'],
preprocessors: {

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show more