Skip to content

Instantly share code, notes, and snippets.

@derekdon
Created July 5, 2016 09:05
Show Gist options
  • Save derekdon/a1b5aa0467d76687fbcc11cddad20b20 to your computer and use it in GitHub Desktop.
Save derekdon/a1b5aa0467d76687fbcc11cddad20b20 to your computer and use it in GitHub Desktop.
Example Ionic 1 webpack.config.js
'use strict';
var webpack = require('webpack'),
path = require('path'),
BowerWebpackPlugin = require('bower-webpack-plugin');
module.exports = {
entry: {
vendor: [
'angular',
'angular-animate',
'angular-sanitize',
'angular-ui-router',
'angular-messages',
'angular-validation-match',
'angular-gettext',
'angular-resource',
'angular-cookies',
'angular-collection',
'ng-material-floating-button',
'ionic',
'lodash',
'ngCordova',
'ionic-service-core',
'ionic-service-analytics',
'ionic-service-push',
'ionic-service-deploy',
'ionic-timepicker'
],
app: './app'
},
output: {
path: __dirname + '/www',
filename: '[name].bundle.js',
chunkFilename: '[id].bundle.js'
},
resolve: {
modulesDirectories: ['node_modules', 'vendor', 'app', 'app/module', 'scss']
},
module: {
loaders: [
{ test: /\.json$/, loaders: ['json'] },
{ test: /\.(png|jpg|gif)$/, loader: 'url?limit=8192' },
{ test: /\.css$/, loader: 'style!css' },
{ test: /\.scss$/, loader: 'style!css!sass' },
{ test: /\.(woff|woff2)($|\?)/, loader: 'url?limit=10000&minetype=application/font-woff' },
{ test: /\.(ttf|eot|svg)($|\?)/, loader: 'file-loader' },
{ test: /\.(htm|html)$/, loader: 'html-loader' }
]
},
plugins: [
new BowerWebpackPlugin(),
new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.bundle.js')
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment