1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- var path = require("path"),
- webpack = require("webpack");
- var staticPrefix = "src/sentry/static/sentry",
- distPath = staticPrefix + "/dist";
- var config = {
- context: path.join(__dirname, staticPrefix),
- entry: {
- "app": "app",
- "vendor": [
- "babel-core/polyfill",
- "bootstrap/js/dropdown",
- "bootstrap/js/tab",
- "bootstrap/js/tooltip",
- "crypto-js/md5",
- "jquery",
- "moment",
- "raven-js",
- "react/addons",
- "react-datepicker",
- "react-document-title",
- "react-router",
- "react-bootstrap",
- "reflux",
- "selectize",
- "flot/jquery.flot",
- "flot/jquery.flot.stack",
- "flot/jquery.flot.time",
- "flot-tooltip/jquery.flot.tooltip",
- "vendor/simple-slider/simple-slider"
- ]
- },
- module: {
- loaders: [
- {
- test: /\.jsx?$/,
- loader: "babel-loader",
- include: path.join(__dirname, staticPrefix),
- exclude: /(vendor|node_modules)/
- }
- ]
- },
- plugins: [
- new webpack.optimize.CommonsChunkPlugin("vendor", distPath + "/vendor.js"),
- new webpack.optimize.UglifyJsPlugin(),
- new webpack.optimize.DedupePlugin(),
- new webpack.ProvidePlugin({
- $: 'jquery',
- jQuery: 'jquery',
- "window.jQuery": "jquery",
- "root.jQuery": "jquery"
- })
- ],
- resolve: {
- alias: {
- "flot": path.join(__dirname, staticPrefix, "vendor", "jquery-flot"),
- "flot-tooltip": path.join(__dirname, staticPrefix, "vendor", "jquery-flot-tooltip"),
- },
- modulesDirectories: [path.join(__dirname, staticPrefix), "node_modules"],
- extensions: ["", ".jsx", ".js", ".json"]
- },
- output: {
- filename: distPath + "/[name].js",
- libraryTarget: "var",
- library: "exports"
- },
- devtool: 'source-map'
- };
- module.exports = config;
|