mirror of https://github.com/artf/grapesjs.git
nocodeframeworkdrag-and-dropsite-buildersite-generatortemplate-builderui-builderweb-builderweb-builder-frameworkwebsite-builderno-codepage-builder
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
928 B
39 lines
928 B
import path from 'path';
|
|
import pkg from './package.json';
|
|
|
|
const rootDir = path.resolve(__dirname);
|
|
|
|
export default ({ config }) => ({
|
|
...config,
|
|
output: {
|
|
...config.output,
|
|
filename: 'grapes.min.js',
|
|
libraryExport: 'default',
|
|
globalObject: `typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this)`,
|
|
},
|
|
devServer: {
|
|
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
disableHostCheck: true,
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\/index\.js$/,
|
|
loader: 'string-replace-loader',
|
|
query: {
|
|
search: '<# VERSION #>',
|
|
replace: pkg.version
|
|
}
|
|
},
|
|
...config.module.rules,
|
|
],
|
|
},
|
|
resolve: {
|
|
modules: ['src', 'node_modules'],
|
|
alias: {
|
|
jquery: 'cash-dom',
|
|
backbone: `${rootDir}/node_modules/backbone`,
|
|
underscore: `${rootDir}/node_modules/underscore`,
|
|
}
|
|
},
|
|
});
|