Skip to content

Instantly share code, notes, and snippets.

@cyinwei
Forked from scrogson/README
Created May 9, 2016 03:18
Show Gist options
  • Select an option

  • Save cyinwei/ac8f6bb8c7eed2b58239e62f16492731 to your computer and use it in GitHub Desktop.

Select an option

Save cyinwei/ac8f6bb8c7eed2b58239e62f16492731 to your computer and use it in GitHub Desktop.

Revisions

  1. @invalid-email-address Anonymous created this gist Feb 23, 2016.
    5 changes: 5 additions & 0 deletions README
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    1) install npm packages
    2) update brunch-config.js
    3) remove Bootstrap from web/static/css/app.css
    4) rename web/static/css/app.css to web/static/css/app.scss
    5) update web/static/css/app.scss
    2 changes: 2 additions & 0 deletions app.scss
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    $icon-font-path: "/fonts/"; /* use fonts from priv/static/fonts/ */
    @import "bootstrap"; /* imports node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss */
    27 changes: 27 additions & 0 deletions brunch-config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    exports.config = {
    plugins: {
    sass: {
    includePaths: ["node_modules/bootstrap-sass/assets/stylesheets"], // tell sass-brunch where to look for files to @import
    precision: 8 // minimum precision required by bootstrap-sass
    },
    copycat: {
    "fonts": ["node_modules/bootstrap-sass/assets/fonts/bootstrap"] // copy node_modules/bootstrap-sass/assets/fonts/bootstrap/* to priv/static/fonts/
    }
    },
    modules: {
    autoRequire: {
    "js/app.js": [
    "bootstrap-sass", // require bootstrap-sass' JavaScript globally
    "web/static/js/app"
    ]
    }
    },
    npm: {
    enabled: true,
    whitelist: ["phoenix", "phoenix_html", "jquery", "bootstrap-sass"], // pull jquery and bootstrap-sass in as front-end assets
    globals: { // bootstrap-sass' JavaScript requires both '$' and 'jQuery' in global scope
    $: 'jquery',
    jQuery: 'jquery'
    }
    }
    }
    1 change: 1 addition & 0 deletions install-npm-packages.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    npm install --save bootstrap-sass sass-brunch jquery copycat-brunch