-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into main-menu-navigation
- Loading branch information
Showing
4 changed files
with
179 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ | |
/src | ||
/vendor/bundle | ||
/rails_70 | ||
/dist |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import path from 'node:path'; | ||
import { URL, fileURLToPath } from 'node:url'; | ||
import { readFileSync } from 'node:fs'; | ||
import alias from '@rollup/plugin-alias'; | ||
|
||
const packageJson = JSON.parse( | ||
readFileSync(new URL('./package.json', import.meta.url)) | ||
); | ||
|
||
const __dirname = fileURLToPath(new URL('.', import.meta.url)); | ||
const projectRootDir = path.resolve(__dirname); | ||
const assetsDir = path.resolve(projectRootDir, 'app/javascript'); | ||
|
||
|
||
/** | ||
* @type {import('rollup').RollupOptions} | ||
*/ | ||
export default [ | ||
// build dist folder with all files from app/javascript using relative imports. | ||
// let bundler tools like webpack or rollup to process our package | ||
{ | ||
input: ['app/javascript/active_admin.js'], | ||
output: { | ||
format: 'es', | ||
dir: 'dist', | ||
preserveModules: true, | ||
}, | ||
external: Object.keys(packageJson.dependencies), | ||
plugins: [ | ||
alias({ | ||
entries: [ | ||
{ | ||
find: 'active_admin', | ||
replacement: path.join(assetsDir, 'active_admin'), | ||
}, | ||
] | ||
}) | ||
] | ||
} | ||
]; |
This file contains 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