This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function override(config, env) { | |
config.module.rules.push({ | |
test: /\.worker\.js$/, | |
use: { loader: 'worker-loader' } | |
}) | |
return config; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.addEventListener("message", startCounter); | |
function startCounter(event) { | |
console.log(event.data, self) | |
let initial = event.data; | |
setInterval(() => this.postMessage(initial++), 1000); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
... | |
import myWorker from './test.worker'; | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = {counter: 0}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...... | |
...... | |
"scripts": { | |
...... | |
"start": "react-app-rewired start", | |
"build": "react-app-rewired build", | |
"test": "react-app-rewired test --env=jsdom", | |
"eject": "react-scripts eject" | |
...... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// app.component.ts | |
ngOnInit() { | |
const $h1 = $('h1'); | |
$h1.css('color', 'blue'); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** .angular-cli.json */ | |
"scripts": [ | |
"../node_modules/jquery/dist/jquery.min.js", | |
"../node_modules/select2/dist/js/select2.min.js" | |
] | |