Code Monkey home page Code Monkey logo

gassetic's People

Contributors

alex88 avatar jdeniau avatar ollietb avatar robertfausk avatar romanschejbal avatar warren5236 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gassetic's Issues

Gassetic with static files

Hi!

Thanks for sharing this awesome tool!

I used to use gassetic with dynamique html pages, so I can have code like this one:

    {% if platform == 'dev' %}
        <!-- dev:styles.css --><!-- endbuild -->
    {% else %}
        <!-- prod:styles.css --><!-- endbuild -->
    {% endif %}

It works perfectly!
What if I should use gassetic with static file, how can I do that?
Is there a way to have a platform agnostic tag?

      <!-- *:styles.css --><!-- endbuild -->

Cheers,
Thomas.

Filename

Hi,

Sorry to bother you again ;)

I wonder why the given filename is not a filename but a repository name.
I understand the comportement when the files are not concat, but when they are, it is a little weird to have a filename like /js/global.js/global_a9c64ad2aa6e0e0e98b188a5a478640a.js

Thank you

"Error: File to read not found or unreadable" when using gulp-sourcemaps in dev environment

I'm trying to use gulp-sourcemaps with gulp-sass and it seems to work well in any non-dev environments. Is this a feature or a bug?

For instance the following gassetic.yml:

requires:
  sass:       gulp-sass
  plumber:    gulp-plumber
  sourcemaps: gulp-sourcemaps

mimetypes:
  sass:
    dev:
      outputFolder: test/dev
      webPath:      /dev
      tasks:
        - { name: plumber }
        - { name: sourcemaps.init }
        - { name: sass }
        - { name: sourcemaps.write }
    arbitrary:
      outputFolder: test/arbitrary
      webPath:      /arbitrary
      tasks:
        - { name: plumber }
        - { name: sourcemaps.init }
        - { name: sass }
        - { name: sourcemaps.write }
    files:
      sass.css:
        - app/Resources/styles/fonts.scss
        - app/Resources/styles/vendor.scss

default: [sass]

Notice that dev and arbitrary are identical but yield different results:

→ gassetic build --env=arbitrary
[11:58:54] Processing: sass with plumber(), sourcemaps.init(), sass(), sourcemaps.write()
[11:58:54]  - sass.css
[11:58:54] Tested 3 tests, 3 passes, 0 failures: PASS

→ gassetic build --env=dev
[11:58:48] Processing: sass with plumber(), sourcemaps.init(), sass(), sourcemaps.write()
[11:58:48]  - sass.css
[11:58:48] Plumber found unhandled error:
 Error in plugin 'gulp-sass'
Message:
    Error: File to read not found or unreadable: [redacted]/app/Resources/styles/fonts_0.scss

[11:58:48] Tested 3 tests, 3 passes, 0 failures: PASS
[11:58:48] Plumber found unhandled error:
 Error in plugin 'gulp-sass'
Message:
    Error: File to read not found or unreadable: [redacted]/app/Resources/styles/vendor_1.scss

Get rid of replacement part and add twig function

Current syntax like <!-- prod:frontend.css --><!-- endbuild --> looks ugly. Also it requires search and process all of the html files to replace placeholders with actual files. I propose add alternatie implementation:

  1. provide twig function. Instead of
{% if app.environment == 'prod' %}
  <!-- prod:bootstrap.css --><!-- endbuild -->
  <!-- prod:frontend.css --><!-- endbuild -->
{% else %}
  <!-- dev:bootstrap.css --><!-- endbuild -->
  <!-- dev:frontend.css --><!-- endbuild -->
{% endif %}

write just

{% for asset in gassetic_files(['bootstrap.css', 'frontend.css']) %}
    <link rel="stylesheet" href="{{ asset }}" />
{% endfor %}

we can also add async here or alternative media or something else. It is much flexible than now. Or we can add of ctrl+click to the config file from here.

  1. on build gassetic will create file with metadata (var/cache/gassetic.json or maybe configurable mimetypes.css.dev.metadataFile, mimetypes.js.prod.metadataFile ) with content like
{
    "bootstrap.css": {
        "dev": [
            "file1.css",
            "file2.css"
        ],
        "prod": [
            "minified_combined_file_abcdef123_with_md5_of_content.css"
        ]
    }
}
  1. twig function will read this file at runtime (maybe with cache layer on Symfony's part) and return files depends on env and output file.

So after this change watch doesn't require scan all html files and replace each of them. it is enough just update file with metadata.

@romanschejbal can you make changes in gassetic for generating this metadata file please? I don't know coffescript. After your changes I can create twig extension and Symfony bridge for it integration.

How to compile less files?

I have following

    css:
        prod:
            outputFolder: web/css
            webPath:      /css
            tasks:
                - { name: less }
                - { name: minify }
                - { name: concat, args: '%filename%' }
                - { name: freeze }
            htmlTag: '<script type="text/javascript" src="{{ asset("%path%") }}"></script>'
        dev:
            outputFolder: web/css/dev
            webPath:      /css/dev
            tasks: []
        files:
            main.css:
              - lib/bower_components/bootstrap/dist/css/bootstrap.css
              - theme/css/skin/light-blue/*.less

For every file theme/css/skin/light-blue/*.less I get output . If i rename files from .less to .css less code is not compiled to css - ouput files contains raw less code. Am i missing something?

Copy files task

Hi @crossborne!

I try to create a copy task (or symlink) to use fontawesome, but I failed on gassetic.yml configuration.

I would like copy/symlink some files in the same specific directory.
Sample :
I would like all my fonts are copied in web/vendor/compiled/fonts

web/vendor/font-awesome/fonts/FontAwesome.otf => web/vendor/compiled/fonts/FontAwesome.otf
web/vendor/font-awesome/fonts/fontawesome-webfont.eot => web/vendor/compiled/fonts/fontawesome-webfont.eot
web/vendor/font-awesome/fonts/fontawesome-webfont.svg => web/vendor/compiled/fonts/fontawesome-webfont.svg

It's possible with the current last gassetic version ? How ?
I have already install gulp-copy and gulp-sym.

Thank you for your help :)

does this help with semantic-ui?

it seems this is not needed when using semantic-ui right?

I am trying to create a gulpfile that just merges my assets from semantic-ui and my project assets but i am not using bundles on symfony all assets are managed via gulp

Need a '%filename%' expansion for htmlTag

Currently the htmlTag supports a %path% variable expansion to allow the full path of a processed asset (i.e. /assets/compiled/logo.gif) to be placed within the output that gassetic renders. It would also be nice to add a %filename% expansion that allows us to inject only the "original" base filename of the processed asset (i.e. logo.gif) into the output. In this case we would want the original filename (logo.gif) and not the post-processed filename (logo_0.gif) so that we could reference the original filename as needed.

Use case:

htmlTag: '

gassetic should render this as ...

In this way we get full image revving with a reference to the original filename.

Why extra folder?

files:
    style.css:
        - html/src/styles/main.less

why gassetic is creating %outputfilder%/style.css/style.css, and not just plain %outputfolder%/style.css ?

Gassetic is not replacing in Mac OSX

I have been using gassetic in several Symfony2 projects using Linux/Ubuntu without problems. However I tried the same gassetic configuration using MAC OSX and something went wrong. The script never replaces the comments in the twig template but I didn't get an error message. I would be very pleased to know what is going wrong and if there is someone using Mac OSX with gassetic.

Thanks

Splitting assets

There seems to be an issue with splitting assets. I have included two example scenarios below:

Sample gassetic.yml

requires:
    sass: gulp-ruby-sass
mimetypes:
    css:
        dev:
            outputFolder: web/tmp/css
            webPath: /tmp/css
            tasks:
                - { name: sass, args: { style: 'expanded' } }
        prod:
            outputFolder: web/compiled/css
            webPath: /compiled/css
            tasks:
                - { name: sass, args: { style: 'compressed' } }
        files:
            main.css:
                - assets/scss/file1.scss
            global.css:
                - assets/scss/file2.scss
replacementsPaths:
    - app/**/*.html.twig
    - src/**/*.html.twig
default:
    - css

Scenario 1
Including css for file name main.css

{% if app.environment == 'prod' %}
  <!-- prod:main.css --><!-- endbuild -->
{% else %}
  <!-- dev:main.css --><!-- endbuild -->
{% endif %}

Even though I only included main.css, it also includes the css from global.css file name and it becomes:

<!-- dev:main.css -->
<link rel="stylesheet" href="/tmp/css/main.css/file1_0.css">
<link rel="stylesheet" href="/tmp/css/main.css/file2_0.css">
<!-- endbuild -->

Scenario 2
Including css for both main.css and global.css file names

{% if app.environment == 'prod' %}
  <!-- prod:main.css --><!-- endbuild -->
  <!-- prod:global.css --><!-- endbuild -->
{% else %}
  <!-- dev:main.css --><!-- endbuild -->
  <!-- dev:global.css --><!-- endbuild -->
{% endif %}

Each filename includes css from both files

<!-- dev:main.css -->
<link rel="stylesheet" href="/tmp/css/main.css/file1_0.css">
<link rel="stylesheet" href="/tmp/css/main.css/file2_0.css">
<!-- endbuild -->

<!-- dev:global.css -->
<link rel="stylesheet" href="/tmp/css/global.css/file1_0.css">
<link rel="stylesheet" href="/tmp/css/global.css/file2_0.css">
<!-- endbuild -->

Handling images in libraries

If a library contains images (for example a lightbox plugin with a close icon), how can we manage the movement and updating of the images?

Working with assets

I think gassetic is great. But is there an option or a task to copy images, fonts etc over in dev environment so they can exclude the underscore and number like in prod environment? For example: so instead of image_1.png, it would be just image.png. I am wondering how and the best way to link to them while watching them in dev environment.

outputFolder gets deleted

Hi,

after updating to v1.0.7 the root-outputFoder gets deleted on every build.
With the old version only the files/subfolders defined as output were deleted.
Is this by design?

Thanks!

Removing filename from the script path

Assume that this is my yml config:

[...]
        prod:
            outputFolder: dist
            webPath:      /dist
            tasks: [] 
        files:
            javascripts.js:
                - vendor/js/js1.js
                - vendor/js/js2.js
[...]

The generated HTML will contain the following:

<!-- prod:dev -->
<script src="/dist/javascripts.js/js1.js"></script>
<script src="/dist/javascripts.js/js2.js"></script>
<!-- endbuild -->

Since I am not running any tasks, the script src should be /dist/ + js1.js and js2.js. If I were running a concat, then the script src should become /dist/javascripts.js.

Basically, it makes no sense to include the filename from YML into the full path.

Is there any way to run extra gulp tasks post-build?

I would like to use gulp-cdnizer on my project. This plugin acts on a similar level to gassetic - replacing parts of the html. In order to use this alongside gassetic I currently have to run a seperate gulp script after each gassetic build to do this. It would be great if there was a way to trigger this from gassetic. Is this possible?

How can I use gassetic with compass (sass)?

How will I be able to use gassetic with compass?

By importing compass specific files I get
Error: error frontend_10.scss (Line 3: File to import not found or unreadable: compass/reset.

Below my config.

#gassetic.yml
requires:
    sass: gulp-ruby-sass
mimetypes:
    # This section contains the formatters for the css files
    css:
        dev:
            outputFolder: web/css/compiled  # The output folder for your saving your compiled files
            webPath:      /css/compiled     # The web path for the compiled files
            # Run these tasks on your compiled files
            tasks:
                - { name: sass }
            htmlTag: '<link rel="stylesheet" type="text/css" href="{{ asset("%path%") }}">' # custom html tag

        # This is the list of source files to apply the above settings
        files:
            frontend: # This is the output filename
                - src/Acme/FrontendBundle/Resources/public/css/*.scss

# This is the list of files/paths to search and find the replacement tags to insert the
# generated <script> or stylesheet tags
replacementPaths:
    - src/Acme/FrontendBundle/Resources/views/layout.html.twig

default:
    - css
# src/Acme/FrontendBundle/Resources/public/css/frontend.scss

@import "compass/reset";    # this causes build to fail
@import "grid-settings";
...

I also tried gulp-compass as lib but with no luck in getting gassetic running.
Could you please give me a hint or provide an example or update doc?

Carriage return needed

<!-- prod:frontend.css --><!--endbuild-->

does not work

<!-- prod:frontend.css -->
<!--endbuild-->

works

You have to insert a \n in order to make this work.

I think it is more a code bug, but the quickfix would be to correct the documentation.

Apply task on pattern-matching file

I have a weird bug when applying less on bootstrap minified css.

I think that a solution may be to apply less compilation only on *.less files.

It may be usefull too for avoid minification on already minified files (css or js).

missing htmlTag

Default templates for js and css are working now, but I have two sections with the 'missing htmlTag' error:

  1. First one is optimizing & copying images
  2. Second one is combining html files (angular templates) into a single js file (angular templatecache). That generated js file needs to be inserted with js tag

Thanks
Rob

Feature request: Inline file contents

It would be nice to have an option to inline scripts or styles.
So instead of

<script src="/myscript.js"></script>

I get

 <script>...myscript.js contents...</script>

Thanks
Robert

Can i use external config?

Hello there,

I few some trouble when i'm make config with many file, can i import config list of file to use in gassetic.yml?

Like symfony have ..

# app/config/config.yml
imports:
    - { resource: '%kernel.root_dir%/parameters.yml' }

Maybe like this

...
                # This is a cache busting gulp plugin that appends
                #  an md5 of the contents to the filename
                - { name: freeze }
            htmlTag: '<link rel="stylesheet" type="text/css" href="{{ asset("%path%") }}">' # custom html tag

        # This is the list of source files to apply the above settings
        files:
            backend.css: # This is the output filename
                imports:
                    - SomeFile.yml # Another config file
...

Add a `clear` command

Hi @crossborne!

It would be great to have a clear command to remove the script & style tags in HTML files.
I'll use it as pre-commit command to always commit clean HTML files.

It's not a critical enhancement, but since I thought about it multiples times, I share it here.

Thanks again for sharing this awesome tool!

Cheers,
Thomas.

Duplicate file name

Hi,

I got a small bug with the current config:

files:
    - "foo/bar.css"
    - "baz/bar.css"

The output file name for those files is bar.css, and the second one override the first.
A temporary solution is to add a freeze task at the end, but I think this should be treated on the core process.

missing htmlTag

Hi,

after updating to v1.0.7 I got "missing htmlTag" errors for all my mimetypes.
Shouldn't there a default tag like beofre?

Thanks!

Symfony2 integration not working

I've created a very simple gassetic.yml (based on your Symfony docs):

requires:
    concat: gulp-concat
    uglify: gulp-uglify
    freeze: gulp-freeze
    minify: gulp-minify-css

mimetypes:
    css:
        dev:
            outputFolder: web/dist/css
            webPath: /compiled/css
            tasks: []
        files:
            foo.css:
                - src/Acme/DemoBundle/Resources/public/css/demo.css

default:
    - css

Please not that there is no replacementPaths since the example didn't provide one.
I know that's why my <!-- dev:foo.css --><!-- endbuild --> in /symfony/src/Acme/DemoBundle/Resources/views/layout.html.twig aren't replaced. However where should replacementPahts point? To src/**/*Bundle/Resources/view and keep them under VCS and swear to god everyone will grunt gassetic before push? That sounds really excessive. I'm guessing that pointing them to app/cache won't work as well since we're dealing with PHP compiled templates there. How did you manage to make it work?

Segmentation fault

Gassetic was working great but after updating it, I am now getting a segmentation fault when running gassetic.

[08:57:00] Tested 2 tests, 2 passes, 0 failures: PASS
[08:57:00] Tested 2 tests, 2 passes, 0 failures: PASS
Segmentation fault

Replacements on prod doesn't work

my template

{% if app.environment == 'prod' %}

<!-- prod:jquery.js --><!-- endbuild -->

<!-- prod:bootstrap.js --><!-- endbuild -->

<!-- prod:bootstrap-material-design.js --><!-- endbuild -->


<!-- prod:desktop.js --><!-- endbuild -->

{% else %}

<!-- dev:jquery.js -->
<script src="/tmp/js/jquery.js/jquery.min_0.js"></script>
<!-- endbuild -->

<!-- dev:bootstrap.js -->
<script src="/tmp/js/bootstrap.js/bootstrap.min_0.js"></script>
<!-- endbuild -->

<!-- dev:bootstrap-material-design.js -->
<script src="/tmp/js/bootstrap-material-design.js/material_0.js"></script>
<!-- endbuild -->


<!-- dev:desktop.js -->
<script src="/tmp/js/desktop.js/desktop_0.js"></script>
<script src="/tmp/js/desktop.js/Modal_1.js"></script>
<!-- endbuild -->

{% endif %}    

my gassetic.yml

requires:
    freeze: gulp-freeze
    concat: gulp-concat
    uglify: gulp-uglify
    minify: gulp-minify
    less:   gulp-less


mimetypes:

    images:
        prod:
            outputFolder: web/compiled/css/images
            tasks: []
            autoRenaming: false

        dev:
            outputFolder: web/tmp/css/images
            tasks: []
            autoRenaming: false

        files:
            desktop:
                - app/Resources/assets/desktop/images/*

    css:
        deps: 
            - "less"
            - "fonts"

        prod:
            outputFolder: web/compiled/css  # The output folder for your saving your compiled files
            webPath:      /compiled/css     # The web path for the compiled files
            # Run these tasks on your compiled files
            tasks:
                - { name: minify }
                - { name: concat, args: '%filename%' }

        # In 'dev' mode, use these settings
        dev:
            outputFolder: web/tmp/css  # The output files will be saved here
                                       #   (Add the tmp folder to gitignore so that your
                                       #   dev files aren't pushed to your repo)
            webPath:      /tmp/css     # The path used for the frontend
            # This is the list of tasks to run on the files
            # You can add gulp
            tasks: []
            autoRenaming: false        # turn off autorenaming for dev environment
        # In 'prod' mode, use these settings


        files:
            bootstrap.css:
                - bower_components/bootstrap/dist/css/bootstrap.css

            simple-line-icons.css:
                - bower_components/simple-line-icons/css/simple-line-icons.css

            foundation.css:
                - bower_components/foundation/css/foundation.css

            font-awesome.css:
                - bower_components/font-awesome/css/font-awesome.css 


            bootstrap-material-design.css:
                - bower_components/bootstrap-material-design/dist/css/material.min.css 



    less:

        prod:
            outputFolder: web/compiled/css  # The output folder for your saving your compiled files
            webPath:      /compiled/css     # The web path for the compiled files
            # Run these tasks on your compiled files
            tasks:
                - { name: less }
                - { name: minify }
                - { name: concat, args: '%filename%' }

        dev:
            outputFolder: web/tmp/css  # The output files will be saved here
                                       #   (Add the tmp folder to gitignore so that your
                                       #   dev files aren't pushed to your repo)
            webPath:      /tmp/css     # The path used for the frontend
            # This is the list of tasks to run on the files
            # You can add gulp
            tasks:
                - { name: less }
            autoRenaming: false        # turn off autorenaming for dev environment



        files:
            desktop.css:
                - app/Resources/assets/desktop/less/desktop.less
                - app/Resources/assets/desktop/css/Modal.css

    fonts:

        prod:
            outputFolder: web/compiled/css
            tasks: []
            autoRenaming: false

        dev:
            outputFolder: web/tmp/css
            tasks: []
            autoRenaming: false


        files:
            fonts:
                - bower_components/simple-line-icons/fonts/*
                - bower_components/font-awesome/fonts/*
                - bower_components/bootstrap-material-design/dist/fonts/*

    js:

        prod:
            outputFolder: web/compiled/js
            webPath:      /compiled/js
            tasks:
                # This task concats all the files into one
                - { name: concat, args: '%filename%' }
                # This task minifies the scripts
                - { name: uglify, args: { mangle: false } }
                # This is a cache busting gulp plugin that appends
                #  an md5 of the contents to the filename
                - { name: freeze }
            htmlTag: '<script type="text/javascript" src="{{ asset("%path%") }}"></script>'

        dev:
            outputFolder: web/tmp/js
            webPath:      /tmp/js
            tasks: []

        files:
            jquery.js:
                - bower_components/jquery/dist/jquery.min.js

            bootstrap.js:
                - bower_components/bootstrap/dist/js/bootstrap.min.js

            desktop.js:
                - app/Resources/assets/desktop/js/desktop.js   
                - app/Resources/assets/desktop/js/Modal.js

            foundation.js:
                - bower_components/foundation/js/foundation.js

            bootstrap-material-design.js:
                - bower_components/bootstrap-material-design/dist/js/material.js

replacementPaths:
    - app/Resources/views/*.html.twig
    - src/**/*.html.twig

default:
    - js
    - css
    - images

I have tried with

gassetic build --env=prod
gassetic --env=prod
gassetic
...

it process the files properly, but doesn't replace the build tags on template.

Gassetic mssing babel-runtime

npm install -g gassetic
[email protected] /usr/lib/node_modules/gassetic
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])

root@4e1adb116053:/server# gassetic
module.js:327
throw err;
^

Error: Cannot find module 'babel-runtime/core-js/json/stringify'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/usr/lib/node_modules/gassetic/dist/src/index.js:8:18)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)

Allow customisation of tags for CDNs

For Symfony2 it is recommended that you use the asset() function in twig so that CDN paths can be automatically added to any assets

<script type="text/javascript" src="{{ asset("%path%") }}"></script>

Windows slash bugs

I'm run gassetic and few some problem, in osx & linux compile path use "/" slash for directory separator but in windows compile path use "" backslash. So if i run in browser throw an error "not found" cz
"\temp\css" will compile to "mpcss". How to fix it?

Thanks for advice :)

Gassetic compiled path :
1

Browser compiled path :
2

Could the replacement paths specify a different target?

Gassetic makes direct replacements in the replacement files. In my case none of the compiled assets are committed (or uncompiled vendors either), instead the CI server builds them again as part of the deploy. This means that my index.html contains script tags that are not referencing actual files in the repository, and are irrelevant anyway since they get replaced by the CI server's gassetic build.

Ideally I would have something like this:

replacementPaths:
    - { from: base.html.twig, to: compiled.html.twig }

So the base.html.twig acts as a template and stays pretty static, and I could git-ignore compiled.html.twig to make a tidier repo!

Does this make sense? Any thoughts?

Command line arg for config file

Firstly, I'm loving gassetic and what it has done for my frontend asset mgmt. Great job! I'd like to request that we add a command line switch (i.e. --config) that would allow one to specify a config file to be used in place of the standard gassetic.yml. gassetic.yml would still remain as the default, but now developers would be able to specify an alternate config (say gassetic_dev.yml) to use that instead. Having this feature would allow us to reduce the amount of environment specific switching that happens in our templates and replace that with environment specific switching in our configs.

Task error reporting

requires:
     freez: gulp-freeze
# ...

    tasks: 
        - freeze

The "freeze" ('e' is missing) task is not defined, but the console does not explain it, the gassetic command only exits

watch, reload only modified file (dev)

Hi,

I have an improvement proposition. It is not really easy, so I open an issue instead of a PR.

Let's imagine this gassetic.yml file

mimtypes:
    css:
        dev:
            tasks:
                - less
        prod:
            tasks:
                - less
                - concat
        files:
            global.css:
                - "a.css"
                - "b.css"

If I update the a.css file, the b.css file is reloaded too instead of reloading only a.css

Of course, with 2 files, we don't really care, but in my project our have, we have 33 css files in the global.css.
Do you thing it could be something doable to only update the wanted file ?

Thanks

Add config option for brackets pattern

For those who use the Twig, construction <-- {env}:{file} --> can be replaced by {# {env}:{file} #} for cleaning output html, and default for other users.
Maybe add to gassetic.yaml parameter with default value ['<--', '-->']?
replace_brackets: ['{#', '#}']

SASS errors

How can I see errors from SASS? I don't understand how I can have the equivalent of:

gulp.task('sass', function () {
  return gulp.src('./sass/**/*.scss')
    .pipe(sass().on('error', sass.logError))
    .pipe(gulp.dest('./css'));
});

Thanks

Issue with dependency fesevent

Hello,
I have an issue with latest version of gassetic. It required a depency on fesevent, which is not compatible with ubuntu 16.04 apprently:
npm/npm#14042 (comment)

The solution in this comment is working, but as it's an optional dependency why just no remove it?
Thx for attention and thx for your work. Have a nice day

Documentation improvements

Create the following files
Resources/doc/Using-with-Symfony2-twig
Resources/doc/Using-with-Bower
Resources/doc/List-of-gulp-plugins
Resources/doc/examples

Clear command and Twig

When building assets with gassetic, it writes css and js links to twig template with no issues. But when using the gassetic clear command, it only deletes the css and js files in the output folder and not clear the css and js links in twig.

I've tried:

gassetic clear
gassetic clear --env=dev
gassetic clear --env=prod

Anyone else having this issue?

Don't watch by default

it doesn't make sense to always run the watch, especially when developing a lot of javascript, or only using the js mimetype.

i would rather turn on watch by adding a --watch flag

gassetic --watch
gassetic build --env=dev --watch

Missing file on save

Hi,

I work on a remote server, and very often, when gassetic is in watch mode, I got this error:

[11:52:49] ✗ FAIL: Missing 1 expected files: path/of/the/file/i/just/saved.js
[11:52:49] Tested 38 tests, 37 passes, 1 failures: FAIL

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error in plugin 'gulp-expect-file'
Failed 1 expectations

I think that the "watcher" send an event at the start of the "saving" process.
But the file may take some time to save, and if gassetic lookup the file in the same time, it fails.

Is it possible to wait the saving process to be finish, or to add (maybe as an option) a "wait" timeout, maybe with a number of retries ?

Thanks

gulp-replace

Hi,

after updating to v1.0.7 gulp-replace is not working anymore.
My task definition looks like this

  • { name: replace, args: ["../font", "fonts"], filter: ["icons.css"] }

Maybe the new version has problems with array args?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.