akveo / blur-admin

AngularJS Bootstrap Admin Panel Framework
http://akveo.github.io/blur-admin/
Other
11.37k stars 3.09k forks source link

gulp build problem #111

Closed ggunders closed 8 years ago

ggunders commented 8 years ago

this is a really odd one. forgive for asking.

what would cause the generated index.html to include vendor.css and vendor.js.

ive built the project in a standalone directory just fine with the autogenerated vendor-309303 css/js. however when i copy the src dir, bower.json, pakcage.json into a spring server project the build tasks look like they all complete just fine. however, there are two files that cannot be found by the brower when running under spring server(vendor.css and vendor.js)

the other js and css files are good, they can be found by the browser.

why would one folder work and another one not work. tried npm clean and install, rebuild node-sass, ensured the exact gulp files are the same.... lost

thx

ggunders commented 8 years ago

ok i believe this is actually a bug now. i think.

project builds fine as long as the src and dst directories are on equal level with each other.

setup a empty dir structure like this

project/ src/main/srcapp src/main/webapp

put all source files in the srcapp directory change the gulp/conf.js to this

exports.paths = { src: 'src/main/srcapp', dist: 'src/main/webapp', devDist: 'dev-release', tmp: '.tmp', e2e: 'e2e' };

the gulp build process generates different builds and a different index.html

easy to replicate

ggunders commented 8 years ago

this is definitely a issue with gulp paths not being in the same directory level. if you move the source or the dest directory away from the main level the inject.js build script does not find all the injections. assistance greatly appreciated. thanks

vazh commented 8 years ago

why did you copy src too ?

you only need files inside dist folder if you already build it

ggunders commented 8 years ago

I'll comment more soon.

Basically I put source in Src/main/sourcespp

Told build script to put build files in Src/main/webapp

Gulp build will complete w o error and place most of the files in dest directory. However, not all js css maps will be generated. The index injections are different when the src and dest paths are in different hierarchies. Tried numerous scenarios where the paths are not on the same level.

Can't split the src and dest directories.

I can provide more logs

vazh commented 8 years ago

Try gulp serve:build

If no error generated then you need to find another way to work it out

On Thursday, 7 July 2016, ggunders notifications@github.com wrote:

I'll comment more soon.

Basically I put source in Src/main/sourcespp

Told build script to put build files in Src/main/webapp

Gulp build will complete w o error and place most of the files in dest directory. However, not all js css maps will be generated. The index injections are different when the src and dest paths are in different hierarchies. Tried numerous scenarios where the paths are not on the same level.

Can't split the src and dest directories.

I can provide more logs

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/akveo/blur-admin/issues/111#issuecomment-230976659, or mute the thread https://github.com/notifications/unsubscribe/ADB2sALboPyc36-QhTltQe1AmZJOu731ks5qTIE7gaJpZM4JFrMV .

ggunders commented 8 years ago

This is super easy to replicate, im hoping someone could grab the project and move the src directory down one level, change the conf.js to reflect the change and build the project. its a different build result. The build is not picking up the vendor scripts or the css.

ensuring a agnostic build process seems legit as not all project users are going to have the source and dest paths in the root of the project.

gulp serve:build is not a task however serve:dist is and fails when you move the source.

cant find styles/app.css, vendor.css, scripts/app.js, vendor.js the app, styles, scripts directories arent created in the dest path(what u guys call /release)

gulp serve works because its picking all the files from dest, .tmp, /serve. in fact gulp serve generates a serve directory that is completely diff from gulp build it points to unminified code in the root directory. look at the index.html file in .tmp/serve its completely different than in the dest path. observe:

<link rel="stylesheet" href="../../../bower_components/Ionicons/css/ionicons.css" />
<link rel="stylesheet" href="../../../bower_components/angular-toastr/dist/angular-toastr.css" />
<link rel="stylesheet" href="../../../bower_components/animate.css/animate.css" />
<link rel="stylesheet" href="../../../bower_components/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="../../../bower_components/bootstrap-select/dist/css/bootstrap-select.css" />
<link rel="stylesheet" href="../../../bower_components/bootstrap-switch/dist/css/bootstra

the index created from build is suppose to create a self contained app.js, vendor.js, etc - completely different than what serve is doing. bulid does this correctly as long as the source dir is at project top(root)

gulp build doesnt generate a build that another webserver can use due to the missing js, css injects.

I am new to using gulp, im hoping someone can try this quick test. after build, just look at the index.html injections. there are half the number of injections as there should be if you move the src directory away from project root.

its almost like the build script cant find all the bootstrap stuff when you move the source directory...

ggunders commented 8 years ago

ok after lots of debug work on the build scripts, trying to learn gulp i found that the index.html file is what actually tells the build script where to inject to /from. if you move your directories from the root location make sure you update the index.html paths.

vazh commented 8 years ago

well, gulp did inject the path of those js/css into index.html

ggunders commented 8 years ago

closing this as modifications to index.html was key

msegeya commented 8 years ago

Hi guys,

I am facing a similar challenge as ggunders mentioned, can you please specify where exactly is that path that you are referring,that have to be changed/updated ?