Skip to content

Instantly share code, notes, and snippets.

@justin3737
Forked from Turbo87/app.js
Created August 20, 2016 11:13
Show Gist options
  • Save justin3737/a35944db43c25d9dfa45e2df89f227bc to your computer and use it in GitHub Desktop.
Save justin3737/a35944db43c25d9dfa45e2df89f227bc to your computer and use it in GitHub Desktop.

Revisions

  1. @Turbo87 Turbo87 created this gist Feb 15, 2015.
    3 changes: 3 additions & 0 deletions app.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    require('font-awesome/css/font-awesome.css');

    document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
    10 changes: 10 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <title>Webpack Test</title>
    </head>
    <body>
    <script src="bundle.js"></script>
    </body>
    </html>
    19 changes: 19 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    {
    "name": "webpack-font-awesome-test",
    "version": "1.0.0",
    "author": "Tobias Bieniek <[email protected]>",
    "scripts": {
    "dev": "webpack -d",
    "dist": "webpack -p"
    },
    "dependencies": {
    "font-awesome": "^4.3.0"
    },
    "devDependencies": {
    "css-loader": "^0.9.1",
    "file-loader": "^0.8.1",
    "style-loader": "^0.8.3",
    "url-loader": "^0.5.5",
    "webpack": "^1.5.3"
    }
    }
    29 changes: 29 additions & 0 deletions webpack.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    var config = {
    entry: './app.js',
    output: {
    filename: 'bundle.js'
    },
    module: {
    loaders: [{
    test: /\.css$/,
    loader: 'style!css?sourceMap'
    }, {
    test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
    loader: "url?limit=10000&mimetype=application/font-woff"
    }, {
    test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/,
    loader: "url?limit=10000&mimetype=application/font-woff"
    }, {
    test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
    loader: "url?limit=10000&mimetype=application/octet-stream"
    }, {
    test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
    loader: "file"
    }, {
    test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
    loader: "url?limit=10000&mimetype=image/svg+xml"
    }]
    }
    };

    module.exports = config;