Skip to content

Instantly share code, notes, and snippets.

@stepancar
Created December 24, 2015 16:33
Show Gist options
  • Save stepancar/4b1009389d0390acf650 to your computer and use it in GitHub Desktop.
Save stepancar/4b1009389d0390acf650 to your computer and use it in GitHub Desktop.
var webpack = require("webpack");
module.exports = {
entry: {
vendorJquery: ['jquery'], // names of modules (name of module, which u use for import statement in ts/js)
vendorReact: ['react', 'react-dom'], // names of modules (name of module, which u use for import statement in ts/js)
app: './scripts/app/app.tsx',
models: "./scripts/models/country.ts",
components: ["./scripts/components/countryTable.tsx", "./scripts/components/countryTableRow.tsx"],
},
output: {
path: './scripts/bundles/',
filename: "[name].js"
},
resolve: {
extensions: ['', '.Webpack.js', '.web.js', '.ts', '.js', '.tsx']
},
module: {
loaders: [
{
test: /\.tsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'ts-loader'
}
]
},
plugins: [
new webpack.optimize.CommonsChunkPlugin("./scripts/bundles/react.js", ["vendorReact"]),
new webpack.optimize.CommonsChunkPlugin("./scripts/bundles/jquery.js", ["vendorJquery"])
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment