Created
April 22, 2016 14:36
-
-
Save chilversc/9b068f52d303c896bb634c96eaf8cc8d to your computer and use it in GitHub Desktop.
webpack bootstrap-switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"name": "temp", | |
"main": "main.js", | |
"dependencies": { | |
"bootstrap": "3.3.6", | |
"bootstrap-switch": "3.3.2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('bootstrap'); | |
require('bootstrap-switch'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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