Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Compiling the source code

$
0
0

@agv wrote:

Hello,

I have the souce code of go 2.0.12 version.

I tried to compilate it follow the example of maximal proyect but the js file doesn t work in my main project like the last version (1.82).

I import go like this:

import * as go from 'src/go.js';

But is undefined

The package.json of the source code is:

{
"name": "go",
"version": "0.0.0",
"private": false,
"dependencies": {
"ts-loader": "^4.4.2",
"typescript": "^2.9.2",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"webpack-closure-compiler": "^2.1.6"
},
"devDependencies": {},
"author": "Northwoods Software"
}

And the webpack.config.js file is:

const path = require('path');
const ClosureCompilerPlugin = require('webpack-closure-compiler');

module.exports = {
mode: 'production',
entry: path.resolve(__dirname, 'index.ts'), //the index of the source code
output: {
path: path.resolve(__dirname, './'),
library: 'go.js',
libraryTarget: 'umd',
filename: 'go20190702.js'
},
resolve: {
  extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
  // files with `.ts` or `.tsx` extension will be handled by `ts-loader`
  { test: /\.tsx?$/, loader: 'ts-loader' }
]
},
stats: 'errors-only',
plugins: [
new ClosureCompilerPlugin({
  compiler: {
    language_out: 'ECMASCRIPT5',
    process_common_js_modules: true,
  }
})
]
}

Did I follow the steps wrong?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles