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

Add assets copy step to Gulp pipeline #4

Open
RoSk0 opened this issue Nov 9, 2018 · 9 comments
Open

Add assets copy step to Gulp pipeline #4

RoSk0 opened this issue Nov 9, 2018 · 9 comments

Comments

@RoSk0
Copy link
Contributor

RoSk0 commented Nov 9, 2018

When selecting Gult pipeline and Bootstrap 3 we expect Bootstrap assets (fonts, SASS and JS) to be copied to local project directory. This directory should be configurable probably.

@RoSk0
Copy link
Contributor Author

RoSk0 commented Nov 9, 2018

See font task as example here https://www.codevoila.com/post/32/customize-bootstrap-using-bootstrap-sass-and-gulp (this link is more for myself) .

@jenofdoom
Copy link
Contributor

I have added new functionality so that if you select Bootstrap 3 you will be asked an additional question 'Are you using Drupal and Drupal's Bootstrap theme?' which, if you answer yes, will create a folder containing the bootstrap-sass files as 'bootstrap'. This is as per that modules setup instructions - this is a specific enough customisation that I don't think it was worth making more generic for other types of projects.

Please update your version using sudo npm update -g and let me know if this works as you expect.

@RoSk0
Copy link
Contributor Author

RoSk0 commented Feb 13, 2019

Works as expected.

@RoSk0 RoSk0 closed this as completed Feb 13, 2019
@RoSk0
Copy link
Contributor Author

RoSk0 commented Feb 14, 2019

Hm, actually not. When I run npm run build after cleaning up all the stuff (rm -rf bootstrap/ css/ .sass-cache/) I got

 gulp build

[12:40:53] Using gulpfile /vagrant/web/themes/custom/tuft/gulpfile.js
[12:40:53] Starting 'build'...
[12:40:53] Starting 'set-build-flag'...
[12:40:53] Finished 'set-build-flag' after 1.36 ms
[12:40:53] Starting 'scss'...
Error in plugin "sass"
Message:
    scss/style.scss
Error: File to import not found or unreadable: ../bootstrap/assets/stylesheets/bootstrap.
        on line 7 of scss/style.scss
>> @import '../bootstrap/assets/stylesheets/bootstrap';

@RoSk0
Copy link
Contributor Author

RoSk0 commented Feb 17, 2019

It looks like what was done is copy assets on project initialisation. So I added this task in a PR #11 .

@alexey0511
Copy link
Contributor

Answers for drupal theme

? What is the name of your project? drupal-theme
? Where do you want your build process to be installed? New directory 'drupal-theme' created
? What kind of build process do you need? Gulp
? Do you want an index.html file created? No
? Do you want to use Browsersync (auto page reloading server/proxy)? No
? Do you want to add Bootstrap to your project? Yes
? Which version of Bootstrap do you want to use? 3
? Do you want JavaScript build support? No JS support
? Do you want to keep your compiled and uncompiled files in separate trees, or use a flat structure? Flat
? Name of the directory where your uncompiled files will live: scss
? Name of the directory where your built files will be written: css
? Are you using Drupal and Drupal's Bootstrap theme? Yes

@RoSk0
Copy link
Contributor Author

RoSk0 commented Feb 19, 2019

TODO:

  • Renames tasks to be "copy-*"
  • Add bootsrap to .gitignore

@alexey0511
Copy link
Contributor

there is a new version release 0.5.7. It should be fixed there. Please check

@RoSk0
Copy link
Contributor Author

RoSk0 commented Mar 1, 2019

Thanks @alexey0511 !

It works but have number of issues:

  1. In generated Gulp pipeline includePaths: [ './node_modules/bootstrap-sass/assets/stylesheets/' ] should be removed for Drupal
  2. because 'copy-bootstrap' task is last in the build series if the bootstrap directory would be removed after running npm install sass task will not fail series because of .on('error', sass.logError) - so i would prefer to remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants