Commit 96d58989 authored by Dhaval Shah's avatar Dhaval Shah

added es6 js through webpack, vue mismatch issue set version compatible

parent 431752cf
{
"presets": [["@babel/preset-env"] ]
}
\ No newline at end of file
/*# sourceMappingURL=client-modules.min.css.map*/
\ No newline at end of file
{"version":3,"sources":[],"names":[],"mappings":"","file":"client-modules.min.css","sourceRoot":""}
\ No newline at end of file
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("ClientModules", [], factory);
else if(typeof exports === 'object')
exports["ClientModules"] = factory();
else
root["ClientModules"] = factory();
})(window, function() {
return /******/ (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] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = 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;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "./client/src/index.js");
/******/ })
/************************************************************************/
/******/ ({
/***/ "./client/src/index.js":
/*!*****************************!*\
!*** ./client/src/index.js ***!
\*****************************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _samplemodule_app_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./samplemodule/app.js */ "./client/src/samplemodule/app.js");
window.samplemodule = _samplemodule_app_js__WEBPACK_IMPORTED_MODULE_0__["default"];
/***/ }),
/***/ "./client/src/samplemodule/app.js":
/*!****************************************!*\
!*** ./client/src/samplemodule/app.js ***!
\****************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
__webpack_require__(/*! ./build.css */ "./client/src/samplemodule/build.css");
var samplemodule = function samplemodule() {
_classCallCheck(this, samplemodule);
console.log('es6 example');
};
/* harmony default export */ __webpack_exports__["default"] = (samplemodule);
/***/ }),
/***/ "./client/src/samplemodule/build.css":
/*!*******************************************!*\
!*** ./client/src/samplemodule/build.css ***!
\*******************************************/
/*! no static exports found */
/***/ (function(module, exports) {
// removed by extract-text-webpack-plugin
/***/ })
/******/ });
});
//# sourceMappingURL=client-modules.min.js.map
\ No newline at end of file
{"version":3,"sources":["webpack://ClientModules/webpack/universalModuleDefinition","webpack://ClientModules/webpack/bootstrap","webpack://ClientModules/./client/src/index.js","webpack://ClientModules/./client/src/samplemodule/app.js","webpack://ClientModules/./client/src/samplemodule/build.css"],"names":["window","samplemodule","require","console","log"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;AAEAA,MAAM,CAACC,YAAP,GAAsBA,4DAAtB,C;;;;;;;;;;;;;;;ACFAC,mBAAO,CAAC,wDAAD,CAAP;;IACMD,Y,GAEL,wBACA;AAAA;;AACCE,SAAO,CAACC,GAAR,CAAY,aAAZ;AACA,C;;AAEaH,2EAAf,E;;;;;;;;;;;ACRA,yC","file":"client-modules.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"ClientModules\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ClientModules\"] = factory();\n\telse\n\t\troot[\"ClientModules\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./client/src/index.js\");\n","import samplemodule from './samplemodule/app.js';\r\n\r\nwindow.samplemodule = samplemodule;","require('./build.css')\r\nclass samplemodule\r\n{\r\n\tconstructor()\r\n\t{\r\n\t\tconsole.log('es6 example');\r\n\t}\r\n}\r\nexport default samplemodule;","// removed by extract-text-webpack-plugin"],"sourceRoot":""}
\ No newline at end of file
import samplemodule from './samplemodule/app.js';
window.samplemodule = samplemodule;
\ No newline at end of file
require('./build.css')
class samplemodule
{
constructor()
{
console.log('es6 example');
}
}
export default samplemodule;
\ No newline at end of file
/* global __dirname, require, module*/
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');
const env = require('yargs').argv.env; // use --env with webpack 2
let libraryName = 'ClientModules';
let outputFileName = 'client-modules';
let outputFile;
let plugins = [
new ExtractTextPlugin({ filename: 'client-modules.min.css', disable: false, allChunks: false})
];
if (env === 'build')
{
outputFile = outputFileName + '.min.js';
}
else
{
outputFile = outputFileName + '.js';
}
const config = {
entry : __dirname + '/src/index.js',
devtool : 'source-map',
output: {
path : __dirname + '/build',
filename : outputFile,
library : libraryName,
libraryTarget : 'umd',
umdNamedDefine : true
},
externals: {
"jquery": "jQuery",
"bootstrap": "bootstrap"
},
module: {
rules: [
{
test : /(\.jsx|\.js)$/,
loader : 'babel-loader',
exclude : /(node_modules|bower_components)/
},
{
test: /\.css$/,
loader: "style-loader!css-loader",
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
// {
// test : /(\.jsx|\.js)$/,
// loader : 'eslint-loader',
// exclude : /node_modules/
// }
]
},
resolve: {
modules: [path.resolve('./src'), '../node_modules'],
extensions: ['.json', '.js', '.css']
},
plugins: plugins
};
module.exports = config;
\ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run development", "dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "build-client": "cross-env NODE_ENV=development webpack --mode=development --env build --config=client/webpack.config.js",
"development": "npm run build-client && cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch-poll": "npm run watch -- --watch-poll", "watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
...@@ -19,9 +20,11 @@ ...@@ -19,9 +20,11 @@
"lodash": "^4.17.4", "lodash": "^4.17.4",
"resolve-url-loader": "2.3.1", "resolve-url-loader": "2.3.1",
"sass-loader": "7.*", "sass-loader": "7.*",
"vue-template-compiler": "^2.6.8",
"vue": "^2.5.17", "vue": "^2.5.17",
"webpack-rtl-plugin": "^1.7.0" "vue-template-compiler": "^2.5.17",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-rtl-plugin": "^1.8.2"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^3.4.1", "bootstrap": "^3.4.1",
......
...@@ -22,12 +22,14 @@ mix.sass('resources/assets/sass/frontend/app.scss', 'public/css/frontend.css') ...@@ -22,12 +22,14 @@ mix.sass('resources/assets/sass/frontend/app.scss', 'public/css/frontend.css')
'public/css/bootstrap.min.css', 'public/css/bootstrap.min.css',
'public/css/custom-style.css', 'public/css/custom-style.css',
'public/css/loader.css', 'public/css/loader.css',
'public/css/bootstrap-datetimepicker.min.css' 'public/css/bootstrap-datetimepicker.min.css',
'client/build/client-modules.min.css',
], 'public/css/backend-custom.css') ], 'public/css/backend-custom.css')
.js([ .js([
'resources/assets/js/frontend/app.js', 'resources/assets/js/frontend/app.js',
'resources/assets/js/plugin/sweetalert/sweetalert.min.js', 'resources/assets/js/plugin/sweetalert/sweetalert.min.js',
'resources/assets/js/plugins.js' 'resources/assets/js/plugins.js',
'client/build/client-modules.min.js',
], 'public/js/frontend.js') ], 'public/js/frontend.js')
.js([ .js([
'resources/assets/js/backend/app.js', 'resources/assets/js/backend/app.js',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment