Skip to content

Instantly share code, notes, and snippets.

@chilversc
Created April 22, 2016 14:36
Show Gist options
  • Save chilversc/9b068f52d303c896bb634c96eaf8cc8d to your computer and use it in GitHub Desktop.
Save chilversc/9b068f52d303c896bb634c96eaf8cc8d to your computer and use it in GitHub Desktop.
webpack bootstrap-switch
{
"private": true,
"name": "temp",
"main": "main.js",
"dependencies": {
"bootstrap": "3.3.6",
"bootstrap-switch": "3.3.2"
}
}
require('bootstrap');
require('bootstrap-switch');
{
"private": true,
"name": "temp",
"version": "1.0.0",
"main": "main.js",
"devDependencies": {
"bower": "^1.7.9",
"source-map-loader": "^0.1.5",
"webpack": "^1.13.0"
}
}
var join = require('path').join;
var webpack = require('webpack');
require('source-map-loader');
var resolver = new webpack.ResolverPlugin(
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin('bower.json', ['main']));
var config = {
entry: join(__dirname, 'main.js'),
output: {
filename: 'bundle.js'
},
resolve: {
root: __dirname,
modulesDirectories: [join(__dirname, 'bower_components/')]
},
module: {
preLoaders: [{
test: /\.js$/,
loader: 'source-map-loader'
}]
},
devtool: '#source-map',
plugins: [
resolver
]
};
module.exports = config;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment