Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. var css = require('./styles.scss');
  2.  
  3. console.log('hello planet!');
  4.  
  5. let x = 'LOL';
  6. console.log(x);
  7.  
  8. /******/ (function(modules) { // webpackBootstrap
  9. /******/ // The module cache
  10. /******/ var installedModules = {};
  11. /******/
  12. /******/ // The require function
  13. /******/ function __webpack_require__(moduleId) {
  14. /******/
  15. /******/ // Check if module is in cache
  16. /******/ if(installedModules[moduleId]) {
  17. /******/ return installedModules[moduleId].exports;
  18. /******/ }
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ i: moduleId,
  22. /******/ l: false,
  23. /******/ exports: {}
  24. /******/ };
  25. /******/
  26. /******/ // Execute the module function
  27. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  28. /******/
  29. /******/ // Flag the module as loaded
  30. /******/ module.l = true;
  31. /******/
  32. /******/ // Return the exports of the module
  33. /******/ return module.exports;
  34. /******/ }
  35. /******/
  36. /******/
  37. /******/ // expose the modules object (__webpack_modules__)
  38. /******/ __webpack_require__.m = modules;
  39. /******/
  40. /******/ // expose the module cache
  41. /******/ __webpack_require__.c = installedModules;
  42. /******/
  43. /******/ // identity function for calling harmony imports with the correct context
  44. /******/ __webpack_require__.i = function(value) { return value; };
  45. /******/
  46. /******/ // define getter function for harmony exports
  47. /******/ __webpack_require__.d = function(exports, name, getter) {
  48. /******/ if(!__webpack_require__.o(exports, name)) {
  49. /******/ Object.defineProperty(exports, name, {
  50. /******/ configurable: false,
  51. /******/ enumerable: true,
  52. /******/ get: getter
  53. /******/ });
  54. /******/ }
  55. /******/ };
  56. /******/
  57. /******/ // getDefaultExport function for compatibility with non-harmony modules
  58. /******/ __webpack_require__.n = function(module) {
  59. /******/ var getter = module && module.__esModule ?
  60. /******/ function getDefault() { return module['default']; } :
  61. /******/ function getModuleExports() { return module; };
  62. /******/ __webpack_require__.d(getter, 'a', getter);
  63. /******/ return getter;
  64. /******/ };
  65. /******/
  66. /******/ // Object.prototype.hasOwnProperty.call
  67. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  68. /******/
  69. /******/ // __webpack_public_path__
  70. /******/ __webpack_require__.p = "";
  71. /******/
  72. /******/ // Load entry module and return exports
  73. /******/ return __webpack_require__(__webpack_require__.s = 1);
  74. /******/ })
  75. /************************************************************************/
  76. /******/ ([
  77. /* 0 */
  78. /***/ (function(module, exports) {
  79.  
  80. // removed by extract-text-webpack-plugin
  81.  
  82. /***/ }),
  83. /* 1 */
  84. /***/ (function(module, exports, __webpack_require__) {
  85.  
  86. var css = __webpack_require__(0);
  87.  
  88. console.log('hello planet!');
  89.  
  90. let x = 'LOL';
  91. console.log(x);
  92.  
  93. /***/ })
  94. /******/ ]);
  95.  
  96. var path = require('path');
  97. var HtmlWebpackPlugin = require('html-webpack-plugin');
  98. const ExtractTextPlugin = require("extract-text-webpack-plugin");
  99.  
  100. module.exports = {
  101. entry: './src/main.js',
  102. output: {
  103. path: path.resolve(__dirname, 'dist'),
  104. filename: 'bundle.min.js'
  105. },
  106. module: {
  107. rules: [{
  108. test: /.js$/,
  109. exclude: /(node_modules|bower_components)/,
  110. use: {
  111. loader: 'babel-loader',
  112. options: {
  113. presets: ['env']
  114. }
  115. },
  116. test: /.scss$/,
  117. use: ExtractTextPlugin.extract({
  118. fallback: 'style-loader',
  119. use: ['css-loader', 'sass-loader'],
  120. publicPath: "/dist"
  121. })
  122. }]
  123. },
  124. devServer: {
  125. contentBase: path.join(__dirname, "dist"),
  126. compress: true,
  127. stats: "errors-only"
  128. },
  129. plugins: [
  130. new HtmlWebpackPlugin({
  131. title: 'Custom template',
  132. // minify: {
  133. // collapseWhitespace: true
  134. // },
  135. hash: true,
  136. // filename: './../index.html',
  137. template: './src/template.html',
  138. }),
  139. new ExtractTextPlugin({
  140. filename: "style.css",
  141. disable: false,
  142. allChunks: true
  143. })
  144. ]
  145. }
  146.  
  147. {
  148. "name": "pack3",
  149. "version": "1.0.0",
  150. "description": "",
  151. "main": "index.js",
  152. "scripts": {
  153. "test": "echo "Error: no test specified" && exit 1",
  154. "dev": "webpack-dev-server --open",
  155. "dev-old": "webpack -d --watch",
  156. "prod": "webpack",
  157. "clean": "rimraf ./dist/*"
  158. },
  159. "keywords": [],
  160. "author": "",
  161. "license": "ISC",
  162. "devDependencies": {
  163. "babel-core": "^6.24.1",
  164. "babel-loader": "^7.0.0",
  165. "babel-preset-env": "^1.4.0",
  166. "css-loader": "^0.28.0",
  167. "extract-text-webpack-plugin": "^2.1.0",
  168. "html-webpack-plugin": "^2.28.0",
  169. "node-sass": "^4.5.2",
  170. "react": "^15.5.4",
  171. "react-dom": "^15.5.4",
  172. "rimraf": "^2.6.1",
  173. "sass-loader": "^6.0.3",
  174. "style-loader": "^0.16.1",
  175. "webpack": "^2.4.1",
  176. "webpack-dev-server": "^2.4.4"
  177. }
  178. }
  179.  
  180. module: {
  181. rules: [
  182. {
  183. test: /.js$/,
  184. exclude: /(node_modules|bower_components)/,
  185. use: {
  186. loader: 'babel-loader',
  187. options: {
  188. presets: ['env']
  189. }
  190. }
  191. },
  192. {
  193. test: /.scss$/,
  194. use: ExtractTextPlugin.extract({
  195. fallback: 'style-loader',
  196. use: ['css-loader', 'sass-loader'],
  197. publicPath: "/dist"
  198. })
  199. }
  200. ]
  201. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement