mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
Add React and TS to webpacker; add react-rails gem
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const { environment } = require('@rails/webpacker')
|
||||
const typescript = require('./loaders/typescript')
|
||||
const webpack = require('webpack')
|
||||
|
||||
environment.loaders.prepend('typescript', typescript)
|
||||
environment.plugins.append(
|
||||
'Provide',
|
||||
new webpack.ProvidePlugin({
|
||||
|
||||
11
config/webpack/loaders/typescript.js
Normal file
11
config/webpack/loaders/typescript.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const PnpWebpackPlugin = require('pnp-webpack-plugin')
|
||||
|
||||
module.exports = {
|
||||
test: /\.(ts|tsx)?(\.erb)?$/,
|
||||
use: [
|
||||
{
|
||||
loader: 'ts-loader',
|
||||
options: PnpWebpackPlugin.tsLoaderOptions()
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -34,6 +34,9 @@ default: &default
|
||||
- .woff2
|
||||
|
||||
extensions:
|
||||
- .tsx
|
||||
- .ts
|
||||
- .jsx
|
||||
- .mjs
|
||||
- .js
|
||||
- .sass
|
||||
|
||||
Reference in New Issue
Block a user