Skip to content

Commit

Permalink
Restore CWD for loading tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Apr 22, 2024
1 parent 0c699dd commit 811eafd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ BUILD_ESM := true
UGLIFY_ESM := false
CHANGELOG_URL := https://github.com/xdan/jodit/blob/main/CHANGELOG.md
NODE_MODULES_BIN := ./node_modules/.bin
TS_NODE_BASE := $(NODE_MODULES_BIN)/ts-node --project ./tools/tsconfig.json
TS_NODE_BASE := $(NODE_MODULES_BIN)/ts-node --project $(cwd)tools/tsconfig.json
WEBPACK := $(TS_NODE_BASE) $(NODE_MODULES_BIN)/webpack
KARMA := @TS_NODE_TRANSPILE_ONLY=true $(TS_NODE_BASE) $(NODE_MODULES_BIN)/karma start
MOCHA := $(TS_NODE_BASE) $(NODE_MODULES_BIN)/mocha

.PHONY: update
update:
Expand Down
22 changes: 22 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,28 @@ class Config implements IViewOptions {

/**
* Shadow root if Jodit was created in it
*
* ```html
* <div id="editor"></div>
* ```
*
* ```js
* const app = document.getElementById('editor');
* app.attachShadow({ mode: 'open' });
* const root = app.shadowRoot;
*
* root.innerHTML = `
* <link rel="stylesheet" href="./build/jodit.css"/>
* <h1>Jodit example in Shadow DOM</h1>
* <div id="edit"></div>
* `;
*
* const editor = Jodit.make(root.getElementById('edit'), {
* globalFullSize: false,
* shadowRoot: root
* });
* editor.value = '<p>start</p>';
* ```
*/
shadowRoot: Nullable<ShadowRoot> = null;

Expand Down
4 changes: 4 additions & 0 deletions tools/dev-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export const devServer = ({ port, dirname }: Variables): Configuration => ({
directory: path.join(dirname, 'test'),
publicPath: '/test'
},
{
directory: path.join(dirname, 'build'),
publicPath: '/build'
},
{
directory: path.join(dirname, 'src'),
publicPath: '/src'
Expand Down

0 comments on commit 811eafd

Please sign in to comment.