Integrate Draftail with wagtail-client package, Webpack, Sass

This commit is contained in:
Thibaud Colas 2017-12-05 19:50:20 +02:00
parent c163d93b72
commit e18d490859
5 changed files with 15 additions and 0 deletions

View file

@ -12,6 +12,7 @@ import Explorer, {
ExplorerToggle,
initExplorer,
} from './components/Explorer';
import draftail from './components/Draftail';
export {
Button,
@ -22,4 +23,5 @@ export {
Explorer,
ExplorerToggle,
initExplorer,
draftail,
};

View file

@ -20,6 +20,7 @@ module.exports = function exports() {
};
entry[getOutputPath('admin', 'wagtailadmin')] = getEntryPath('admin', 'wagtailadmin.entry.js');
entry[getOutputPath('admin', 'draftail')] = getEntryPath('admin', 'draftail.entry.js');
return {
entry: entry,

View file

@ -0,0 +1,4 @@
import { draftail } from 'wagtail-client';
// Expose as a global variable, for integration with other scripts.
window.draftail = draftail;

View file

@ -0,0 +1,7 @@
require('./draftail.entry');
describe('draftail.entry', () => {
it('exposes global', () => {
expect(window.draftail).toBeDefined();
});
});

View file

@ -0,0 +1 @@
@import '../../../../../../client/src/components/Draftail/Draftail';