Created
March 16, 2015 19:43
-
-
Save jacek-dargiel/2e8d0ba7b1c98f999192 to your computer and use it in GitHub Desktop.
Webpack sourcemaps not working
This file contains hidden or 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
| (function () { | |
| 'use strict'; | |
| // var Backbone = require('Backbone'); | |
| // class HeaderView extends Backbone.View { | |
| // constructor() { | |
| // console.log('constructed') | |
| // } | |
| // } | |
| var halfs = [1,2,3].map(i => i/2); | |
| var HeaderView = function () { | |
| console.log(halfs); | |
| }; | |
| module.exports = HeaderView; | |
| })(); |
This file contains hidden or 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 HeaderView = require('babel!./HeaderView'); | |
| new HeaderView(); |
This file contains hidden or 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
| /******/ (function(modules) { // webpackBootstrap | |
| /******/ // The module cache | |
| /******/ var installedModules = {}; | |
| /******/ // The require function | |
| /******/ function __webpack_require__(moduleId) { | |
| /******/ // Check if module is in cache | |
| /******/ if(installedModules[moduleId]) | |
| /******/ return installedModules[moduleId].exports; | |
| /******/ // Create a new module (and put it into the cache) | |
| /******/ var module = installedModules[moduleId] = { | |
| /******/ exports: {}, | |
| /******/ id: moduleId, | |
| /******/ loaded: false | |
| /******/ }; | |
| /******/ // Execute the module function | |
| /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); | |
| /******/ // Flag the module as loaded | |
| /******/ module.loaded = true; | |
| /******/ // Return the exports of the module | |
| /******/ return module.exports; | |
| /******/ } | |
| /******/ // expose the modules object (__webpack_modules__) | |
| /******/ __webpack_require__.m = modules; | |
| /******/ // expose the module cache | |
| /******/ __webpack_require__.c = installedModules; | |
| /******/ // __webpack_public_path__ | |
| /******/ __webpack_require__.p = ""; | |
| /******/ // Load entry module and return exports | |
| /******/ return __webpack_require__(0); | |
| /******/ }) | |
| /************************************************************************/ | |
| /******/ ([ | |
| /* 0 */ | |
| /***/ function(module, exports, __webpack_require__) { | |
| var HeaderView = __webpack_require__(1); | |
| new HeaderView(); | |
| /***/ }, | |
| /* 1 */ | |
| /***/ function(module, exports, __webpack_require__) { | |
| "use strict"; | |
| (function () { | |
| "use strict"; | |
| // var Backbone = require('Backbone'); | |
| // class HeaderView extends Backbone.View { | |
| // constructor() { | |
| // console.log('constructed') | |
| // } | |
| // } | |
| var halfs = [1, 2, 3].map(function (i) { | |
| return i / 2; | |
| }); | |
| var HeaderView = function HeaderView() { | |
| console.log(halfs); | |
| }; | |
| module.exports = HeaderView; | |
| })(); | |
| /***/ } | |
| /******/ ]); |
This file contains hidden or 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 path = require("path"); | |
| var webpack = require("webpack"); | |
| module.exports = { | |
| entry: './js/main.js', | |
| output: { | |
| path: './', | |
| filename: 'codebase.js' | |
| }, | |
| resolve: { | |
| root: [path.join(__dirname, "bower_components")] | |
| }, | |
| plugins: [ | |
| new webpack.ResolverPlugin( | |
| new webpack.ResolverPlugin.DirectoryDescriptionFilePlugin("bower.json", ["main"]) | |
| ) | |
| ], | |
| devTool: '#inline-source-map', | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment