Created
March 17, 2015 10:46
-
-
Save s-panferov/81b9228d2f4d2b57e0f2 to your computer and use it in GitHub Desktop.
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 webpack = require('webpack'); | |
var path = require("path"); | |
module.exports = { | |
entry: { | |
app: './src/app/app.ts', | |
vendor: [ | |
"jquery", | |
"jquery-mockjax", | |
"baconjs", | |
"tether", | |
"codemirror", | |
"faye", | |
"bragi", | |
"i18n", | |
"iscroll", | |
"lodash", | |
"moment", | |
"moment-duration-format", | |
"moment-timezone", | |
"uuid", | |
"nprogress", | |
"pleasejs", | |
"react", | |
"select2", | |
"tv4", | |
"underscore.string", | |
"URIjs", | |
"xregexp", | |
"bemr" | |
] | |
}, | |
resolve: { | |
root: [path.join(__dirname, "bower_components")], | |
extensions: ['', '.ts', '.webpack.js', '.web.js', '.js'], | |
alias: { | |
"react/addons": "react/dist/react-with-addons.js", | |
"react": "react/dist/react-with-addons.js", | |
"bragi": "bragi-browser/lib/bragi.js", | |
"i18n": "i18next/lib/dep/i18next", | |
"underscore.string": "underscore.string/index.js", | |
"uuid": "node-uuid", | |
"iscroll": "iscroll/build/iscroll-probe.js", | |
"_iscroll": path.join(__dirname, "src/vendor/iscroll-probe-monkey.js"), | |
"$rx": "rx/dist/rx.lite.js", | |
"rx.binding": "rx/dist/rx.binding.js", | |
} | |
}, | |
output:{ | |
path: './dist', | |
filename: '[name].js', | |
}, | |
node: { | |
fs: "empty" | |
}, | |
// Source maps support (or 'inline-source-map' also works) | |
devtool: 'source-map', | |
// Add loader for .ts files. | |
module: { | |
loaders: [ | |
{ | |
test: /\.ts$/, | |
loader: 'awesome-typescript-loader?showRecompileReason=true&sync=true' | |
}, | |
{ | |
test: /\.css$/, | |
loader: "style-loader!css-loader" | |
}, | |
{ | |
test: /\.scss$/, | |
// Query parameters are passed to node-sass | |
loader: "style!css!sass?outputStyle=expanded&" + | |
"includePaths[]=" + | |
(path.resolve(__dirname, "./bower_components")) + "&" + | |
"includePaths[]=" + | |
(path.resolve(__dirname, "./node_modules")) + "&" + | |
"includePaths[]=" + | |
(path.resolve(__dirname, "./src/styles")) | |
}, | |
{ | |
test: /\.(ttf|eot|svg|woff)(\?.*)?$/, | |
loader: "url-loader?limit=10000&minetype=application/font-eot&name=/[name].[ext]?v=[hash]" | |
}, | |
{ | |
test: /\.json?$/, | |
loader: "json-loader" | |
}, | |
{ | |
test: /jquery-mockjax/, | |
loader: 'imports?jQuery=jquery' | |
}, | |
//{ | |
// test: /xregexp/, | |
// loader: 'imports?XRegExp=xregexp' | |
//} | |
] | |
}, | |
plugins: [ | |
new webpack.optimize.CommonsChunkPlugin(/* chunkName= */"vendor", /* filename= */"vendor.js"), | |
new webpack.ResolverPlugin( | |
new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"]) | |
) | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment