Add aliases for common module locations
This commit is contained in:
parent
fcd7217126
commit
89127aa313
|
@ -1,6 +1,6 @@
|
|||
import start from '../retrospring/common';
|
||||
import initAnswerbox from '../retrospring/features/answerbox/index';
|
||||
import initInbox from '../retrospring/features/inbox/index';
|
||||
import start from 'retrospring/common';
|
||||
import initAnswerbox from 'retrospring/features/answerbox/index';
|
||||
import initInbox from 'retrospring/features/inbox/index';
|
||||
|
||||
start();
|
||||
document.addEventListener('turbolinks:load', initAnswerbox);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import registerEvents from "retrospring/utilities/registerEvents";
|
||||
import {createShareEvent} from "./share";
|
||||
import registerEvents from 'utilities/registerEvents';
|
||||
import { createShareEvent } from './share';
|
||||
|
||||
export default (): void => {
|
||||
if ('share' in navigator) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import noop from 'retrospring/utilities/noop';
|
||||
import noop from 'utilities/noop';
|
||||
|
||||
export function createShareEvent(answerbox: HTMLElement): () => void {
|
||||
return function (): void {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import registerEvents from "retrospring/utilities/registerEvents";
|
||||
import {reportEventHandler} from "./report";
|
||||
import registerEvents from 'utilities/registerEvents';
|
||||
import { reportEventHandler } from './report';
|
||||
|
||||
export default (): void => {
|
||||
const entries: NodeList = document.querySelectorAll('.inbox-entry:not(.js-initialized)');
|
||||
|
||||
entries.forEach((element: HTMLElement) => {
|
||||
registerEvents([
|
||||
{type: 'click', target: element.querySelector('[name=ib-report]'), handler: reportEventHandler}
|
||||
{ type: 'click', target: element.querySelector('[name=ib-report]'), handler: reportEventHandler }
|
||||
]);
|
||||
|
||||
element.classList.add('js-initialized');
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
const path = require('path')
|
||||
const { environment } = require('@rails/webpacker')
|
||||
const coffee = require('./loaders/coffee')
|
||||
|
||||
environment.loaders.prepend('coffee', coffee)
|
||||
|
||||
environment.config.merge({
|
||||
resolve: {
|
||||
alias: {
|
||||
retrospring: path.resolve(__dirname, '..', '..', 'app/javascript/retrospring'),
|
||||
utilities: path.resolve(__dirname, '..', '..', 'app/javascript/retrospring/utilities')
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = environment
|
||||
|
|
|
@ -8,7 +8,9 @@
|
|||
"moduleResolution": "node",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"*": ["node_modules/*", "app/javascript/*"]
|
||||
"*": ["node_modules/*", "app/javascript/*"],
|
||||
"retrospring/*": ["app/javascript/retrospring/*"],
|
||||
"utilities/*": ["app/javascript/retrospring/utilities/*"]
|
||||
},
|
||||
"sourceMap": true,
|
||||
"target": "es5",
|
||||
|
|
Loading…
Reference in New Issue