loleaflet: browserify-css, use the global transform option

Change-Id: I058c3befc8c89d67faf35bf3ab0142893c3b7b47
This commit is contained in:
Henry Castro 2018-04-29 17:26:04 -04:00
parent 8aaddac926
commit 80bbab39f0
4 changed files with 7 additions and 11 deletions

View file

@ -19,7 +19,7 @@ var build = require('./build/build.js'),
function hint(msg, args) {
return function () {
console.log(msg);
jake.exec('node node_modules/eslint/bin/eslint.js ' + args,
jake.exec('node ' + builddir + 'node_modules/eslint/bin/eslint.js ' + args,
{printStdout: true}, function () {
console.log('\tCheck passed.\n');
complete();

View file

@ -139,8 +139,9 @@ function bytesToKB(bytes) {
}
function bundle(files, destFilename, debug, minify, callback) {
var bundler = browserify(files, {debug: debug});
bundler = bundler.transform(browserifyCss);
var node_paths = builddir !== '' ? [builddir + 'node_modules'] : [process.cwd() +'/node_modules']
var bundler = browserify(files, {debug: debug, paths:node_paths});
bundler = bundler.transform(browserifyCss, {global:true});
if (minify) {
console.log('uglifying');
bundler.transform({

View file

@ -1,9 +1,9 @@
// CSS requires
require('./node_modules/bootstrap/dist/css/bootstrap.css');
require('bootstrap/dist/css/bootstrap.css');
require('./dist/admin/bootstrap/ie10-viewport-bug-workaround.css');
require('./dist/admin/bootstrap/dashboard.css');
require('./node_modules/vex-js/css/vex.css');
require('./node_modules/vex-js/css/vex-theme-plain.css');
require('vex-js/css/vex.css');
require('vex-js/css/vex-theme-plain.css');
var $ = require('jquery');
global.$ = global.jQuery = $;

View file

@ -29,11 +29,6 @@
"browser": {
"loleaflet": "./dist/leaflet-src.js"
},
"browserify": {
"transform": [
"browserify-css"
]
},
"main": "main.js",
"style": "main.css",
"scripts": {