Skip to content

Instantly share code, notes, and snippets.

@Vayvala
Last active January 28, 2016 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vayvala/67d728f86b564ccdf02e to your computer and use it in GitHub Desktop.
Save Vayvala/67d728f86b564ccdf02e to your computer and use it in GitHub Desktop.
'use strict';
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const srcDir = 'public';
const dstDir = 'dist';
const entry = 'entry.js';
const output = 'bundle.js';
const config = {
context: path.join(__dirname, srcDir),
entry: {
app: [path.join(__dirname, srcDir, entry)],
},
output: {
path: path.join(__dirname, dstDir),
filename: output,
},
module: {
loaders: [
{test: /\.js$/, loader: 'ng-annotate', exclude: /node_modules/},
{test: /\.js$/, loader: 'babel', exclude: /node_modules/, query: {
presets: ['es2015']
}},
{test: /\.html$/, loader: 'html', exclude: /node_modules/},
{test: /\.css$/, loader: 'style!css'},
{test: /\.(jpg|png)$/, loader: 'url?limit=10000'},
{test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'url-loader?limit=10000&mimetype=application/font-woff'},
{test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: 'file-loader'}
],
},
resolve: {
root: path.resolve(__dirname),
alias: {},
extensions: ['', '.js', '.es6']
}
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment