Giter VIP home page Giter VIP logo

generator-modern-frontend's Introduction

NOT MAINTAINING THIS PROJECT: Use webpack instead.

generator-modern-frontend Build Status

Yeoman generator that scaffolds out a modern front-end web app using gulp. Inspired by generator-gulp-webapp.

Features

  • Browserify + ES6 (babelify)
  • Pick your favorite CSS pre-processor (Sass, Stylus or Less)
  • CSS Autoprefixing
  • Sourcemaps for CSS and JavaScript
  • Built-in preview server with BrowserSync
  • Image optimization
  • Wire-up dependencies installed with Bower

You may opt-out from using bower, sprite generation and image optimization if you don't need them.

Sprite sheet

For sprite generation, you'll need to create a directory for each sprite category on app/images/sprites/. It will generate its respective stylesheet and sprite sheet files as the following:

  • app/images/sprites/general/*.png generates:
    • css/sprites/general.styl
    • images/sprites_general.png
  • app/images/sprites/heavy_stuff/*.png generates:
    • css/sprites/heavy_stuff.styl
    • images/sprites_heavy_stuff.png

Please see our gulpfile.js for up to date information on what we support.

For more information on what this generator can do for you, take a look at the gulp plugins used in our package.json.

Getting Started

  • Install dependencies: npm install --global yo bower
  • Install the generator: npm install --global generator-modern-frontend
  • Run yo modern-frontend to scaffold your webapp
  • Run npm start to preview and watch for changes
  • Run bower install --save <package> to install frontend dependencies
  • Run gulp to build for production

Bower components

This generator includes the following Bower components by default:

  • Modernizr
  • normalize.css

Read the details about our Bower setup.

Options

  • --skip-install Skips the automatic execution of bower and npm after scaffolding has finished.

License

BSD license

generator-modern-frontend's People

Contributors

contolini avatar endel avatar mcfiredrill 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

Watchers

 avatar  avatar  avatar  avatar

generator-modern-frontend's Issues

[sass] Include sprites

Hi there,

I would like a quick guide on how to use the sprites in this setup, I've used this on a project as a test and i cant seem to figure out how to use/generate the sprites.

Error: CSS parse error js/main.js: Unexpected input

Got this error after running:
$ gulp

=============================

events.js:160
throw er; // Unhandled 'error' event
^
Error: CSS parse error js/main.js: Unexpected input
1 |!function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var s=n[i]={exports:{}};e[i][0].call(s.exports,function(r){var n=e[i][1][r];return o(n?n:r)},s,s.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}({1:[function(r,e,n){"use strict";console.log("yay")},{}]},{},[1]);
-------^

==============================

Handlebars integration

Hi there,

I'm curious how I could integrate handlebars into this build. I'm new to gulp/browserify.

Thanks!

Won't install

I'm not sure if this is an issue with the generator or what, but I've run

npm install --global generator-modern-frontend

Twice from the command line and once through Yo itself, and I can't get Yo to recognize that the generator is available

Error initialising the generator on choosing SCSS

First question after initiating the generator is preprocessor, on answering this the process falls over.
Error as follows:

? Which CSS preprocessor would you like to use? SCSS

events.js:85
  throw er; // Unhandled 'error' event
        ^
AssertionError: Trying to copy from a source that does not exist: /usr/local/lib/node_modules/generator-modern-frontend/app/templates/mainundefined
at EditionInterface.exports._copySingle (/usr/local/lib/node_modules/generator-modern-frontend/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:44:3)
at EditionInterface.exports.copy (/usr/local/lib/node_modules/generator-modern-frontend/node_modules/yeoman-generator/node_modules/mem-fs-editor/actions/copy.js:22:17)
at module.exports.yeoman.generators.Base.extend.writing.app (/usr/local/lib/node_modules/generator-modern-frontend/app/index.js:83:15)
at /usr/local/lib/node_modules/generator-modern-frontend/node_modules/yeoman-generator/lib/base.js:409:16
at processImmediate [as _immediateCallback] (timers.js:367:17)

On installing the generator there were these warnings:

 npm WARN deprecated [email protected]: the module is now available as 'css-select'
 npm WARN deprecated [email protected]: the module is now available as 'css-what'

JS Build does not work as expected

What is wrong with this html code:

<!-- build:js js/main.min.js -->
    <script src="js/main.js" charset="utf-8"></script>
    <script src="js/pages/orders.js" charset="utf-8"></script>
<!-- endbuild -->

And this gulp task:

gulp.task('javascript', function () {
  return gulp.src('app/js/main.js')
    .pipe(through2.obj(function (file, enc, next){ // workaround for https://github.com/babel/babelify/issues/46
      browserify({
        entries: file.path,
        debug: isDevelopment
      }).bundle(function(err, res){
        if (err) { return next(err); }

        file.contents = res;
        next(null, file);
      });
    }))
    .on('error', function (error) {
      console.log(error.stack);
      this.emit('end');
    })
    .pipe(gulp.dest('dist/js'))
    .pipe($.if(isDevelopment, $.sourcemaps.init({loadMaps: true})))
    .pipe($.if(isDevelopment, $.sourcemaps.write('.')))
    .pipe(gulp.dest('.tmp/js'));
});

Because I'm always getting only main.js inside main.min.js file, instead of main.js and orders.js merged and minified together into main.min.js ๐Ÿ˜ข

Thank you!

javascript being concatenated twice

I always seem to end up with two copies of my Javascript concatenated together in my dist/main.js file. Then I remove the .tmp directory and it seems to fix the issue.

I guess technically I'm supposed to use gulp clean and it will remove that directory, but is it feasible to remove the .tmp directory before the build starts if it exists, to help save users from this potential problem?

Bootstrap dependency not being added

After bower install --save bootstrap, its included in my index.html the <script> tag from bootstrap.js but the bootstrap.css file is not being included.

I'm using all the default options when generating with SCSS.

Any help?

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.