Skip to content

Instantly share code, notes, and snippets.

@carvalhoviniciusluiz
Created December 5, 2016 11:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save carvalhoviniciusluiz/d1cdf4b9284e857d64a9577d39c8bb04 to your computer and use it in GitHub Desktop.
Require.js to Webpack
var webpack = require('webpack');
module.exports = {
entry: [ "app/app" ]
, output: {
path: __dirname + "/build"
, filename: "bundle.js"
, publicPath: "/build/"
}
, resolve: {
// modulesDirectories: ["app/lib"]
alias: {
vue: "vue/dist/vue.js"
, app : __dirname + "/app"
, collections : __dirname + "/app/collections"
, components : __dirname + "/app/components"
, locales : __dirname + "/app/locales"
, models : __dirname + "/app/models"
, helper : __dirname + "/app/helper"
, templates : __dirname + "/app/templates"
, views : __dirname + "/app/views"
}
}
, plugins: [
new webpack.ProvidePlugin({
$: "jquery"
, jQuery: "jquery"
})
],
module: {
loaders: [
{ test: /\.html$/ , loader: "text-loader" }
, { test: /prismjs/, loader: 'exports?Prism' }
, { test: /underscore/, loader: 'exports?_' }
, { test: /backbone/, loader: 'exports?Backbone!imports?underscore,jquery' }
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment