Created
December 5, 2016 11:20
-
-
Save carvalhoviniciusluiz/d1cdf4b9284e857d64a9577d39c8bb04 to your computer and use it in GitHub Desktop.
Require.js to Webpack
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'); | |
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