Skip to content

Instantly share code, notes, and snippets.

@taikulawo
Last active February 12, 2024 00:05
Show Gist options
  • Save taikulawo/4e048d8669c332cecee2233f850c69d4 to your computer and use it in GitHub Desktop.
Save taikulawo/4e048d8669c332cecee2233f850c69d4 to your computer and use it in GitHub Desktop.
Uncaught TypeError: $(...).splitPane is not a function
at eval (main.ts:11)
at Object../src/main.ts (main.js:formatted:295)
at __webpack_require__ (main.js:formatted:37)
at main.js:formatted:181
at main.js:formatted:186
/// <reference path="../typings.d.ts" />
import * as $ from 'jquery';
import * as ace from 'brace';
import 'brace/mode/javascript';
import 'brace/theme/monokai';
import 'raw-loader!../vendor/split-pane.js';
$('.ide-code-run').on('click',function(){
alert("hello");
})
$("div.split-pane").splitPane()
var aceEditor = ace.edit("ace-editor");
aceEditor.setTheme("ace/theme/textmate");
aceEditor.setShowPrintMargin(false);
aceEditor.session.setMode("ace/mode/javascript");
var resize = function () {
$(document).on("mousemove", function () {
aceEditor.resize();
})
}
$("split-pane-divider").on("mousedown", (evt: JQuery.Event) =>{resize()});
$(document).off("mouseup",resize)
{
"name": "onlinecode",
"version": "0.0.1",
"dependencies": {
"brace": "^0.11.1"
},
"scripts": {
"build": "webpack --config ./webpack.config.js --progress --color --verbose --display-entrypoints --display-chunks --display-error-details"
},
"devDependencies": {
"@types/jquery": "^3.3.5",
"json-loader": "^0.5.7",
"script-loader": "^0.7.2",
"ts-loader": "^4.4.2",
"typescript": "^3.0.1",
"uglify-js": "^3.4.7",
"uglify-loader": "^2.0.0",
"webpack": "^4.16.5",
"webpack-cli": "^3.1.0"
},
"main": "webpack.config.js",
"author": "",
"license": "ISC",
"description": ""
}
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"removeComments":true,
"allowJs":true
},
"include": [
"./src/**/*"
]
}
> webpack --config ./webpack.config.js --progress --color --verbose --display-entrypoints --display-chunks --display-error-details
Hash: b02a0db8c782dae66c5a
Version: webpack 4.16.5
Time: 2524ms
Built at: 2018-08-16 08:42:54
Asset Size Chunks Chunk Names
main.js 1.28 MiB main [emitted] main
Entrypoint main = main.js
chunk {main} main.js (main) 1.2 MiB [entry] [rendered]
> ./src/main.ts main
[./node_modules/raw-loader/index.js!./vendor/split-pane.js] ./node_modules/raw-loader!./vendor/split-pane.js 18.7 KiB {main} [depth 1] [built]
cjs require raw-loader!../vendor/split-pane.js [./src/main.ts] 7:0-45
[./node_modules/webpack/buildin/amd-define.js] (webpack)/buildin/amd-define.js 85 bytes {main} [depth 2] [built]
amd require define [./node_modules/brace/index.js] 4181:93-99
amd require define [./node_modules/brace/index.js] 20208:21-27
[./src/main.ts] 757 bytes {main} [depth 0] [built]
single entry ./src/main.ts main
+ 5 hidden modules
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './src/main.ts',
mode:"development",
target:"web",
output: {
filename: '[name].js',
path: __dirname + '/dist/public/assets/js'
},
resolve: {
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/
}
]
},
// optimization: {
// splitChunks: {
// cacheGroups: {
// vendor: {
// chunks: 'initial',
// name: 'vendor',
// test: 'vendor',
// enforce: true
// },
// },
// chunks:"all",
// minSize:0,
// minChunks:2,
// },
// runtimeChunk: false
// },
plugins:[
new webpack.ProvidePlugin({
$:'jquery',
jQuery:'jquery',
'window.jQuery': "jquery",
})
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment