Browse Source

Early support for r.js

dev/git-series/gccdum
Matt Godbolt 7 years ago
parent
commit
49e1ad9ebd
  1. 1
      .gitignore
  2. 6
      Makefile
  3. 16
      app.build.js
  4. 1
      app.js
  5. 3
      package.json

1
.gitignore vendored

@ -2,4 +2,5 @@
/node_modules
/.npm-updated
/.bower-updated
/out
*.heapsnapshot

6
Makefile

@ -17,6 +17,7 @@ endif
endif
.PHONY: clean run test run-amazon c-preload optional-d-support prereqs node_modules bower_modules
.PHONY: dist
prereqs: optional-d-support node_modules c-preload bower_modules
ifeq "" "$(shell which gdc)"
@ -48,13 +49,16 @@ test:
@echo Tests pass
clean:
rm -rf bower_modules node_modules .npm-updated .bower-updated
rm -rf bower_modules node_modules .npm-updated .bower-updated out
$(MAKE) -C d clean
$(MAKE) -C c-preload clean
run: prereqs
$(NODE) ./node_modules/.bin/supervisor -e 'js|node|properties' --exec $(NODE) -- ./app.js --language $(LANG)
dist: prereqs
$(NODE) ./node_modules/requirejs/bin/r.js -o app.build.js
c-preload:
$(MAKE) -C c-preload

16
app.build.js

@ -0,0 +1,16 @@
({
appDir: "static",
baseUrl: ".",
dir: "out/dist",
generateSourceMaps: true,
preserveLicenseComments: false,
optimize: "uglify2",
removeCombined: true,
useStrict: true,
mainConfigFile: "static/main.js",
modules: [
{
name: "main"
}
]
})

1
app.js

@ -418,6 +418,7 @@ findCompilers().then(function (compilers) {
.use(logger('combined'))
.use(compression())
.use(sFavicon('static/favicon.ico'))
.use(sStatic('out/dist', {maxAge: staticMaxAgeMs}))
.use(sStatic('static', {maxAge: staticMaxAgeMs}))
.use(bodyParser.json())
.use(restreamer())

3
package.json

@ -32,7 +32,8 @@
},
"devDependencies": {
"supervisor": "0.3.1",
"bower": "*"
"bower": "*",
"requirejs": "*"
},
"scripts": {
"test": "make test"

Loading…
Cancel
Save