[vtkusers] Problem with webpack configuration on CentOS

Andrzej Marciniak marciniak.andrzej.zg at gmail.com
Thu Mar 7 16:21:21 EST 2019


Hi,

We have application with VTK viewer working properly on Windows, MacOS and
Ubuntu, but when I migrated it to CentOS 7.3, the viewer does not work. When
shaders are compiled, the code of Shader is prefixed with:
"module.exports = ",
eg. 
"module.exports = "#version 300 es↵#define attribute ...etc. etc.

What can be wrong?
We use the following dependencies: 
"babel-cli": "^7.0.0-0",
    "babel-core": "^7.0.0-0",
    "babel-loader": "^7.1.2",
    "babel-polyfill": "^7.0.0-0",
    "babel-preset-env": "^1.6.1",
    "babel-preset-es2015": "^7.0.0-0",
    "babel-preset-react": "^7.0.0-0",
    "babel-register": "^7.0.0-0",
    "babelify": "^8.0.0",...,

    "vtk.js": "^8.3.2",
    "webpack": "^3.8.1",
    "webpack-cli": "^2.0.14",
    "webpack-dev-server": "^2.9.4",
    "worker-loader": "^1.1.1"

dev-dep: 
 "devDependencies": {
    "@babel/preset-stage-3": "^7.0.0",
    "css-loader": "^0.28.7",
    "file-loader": "^1.1.5",
    "jest": "^23.6.0",
    "kw-web-suite": "^8.0.0",
    "node-sass": "^4.6.0",
    "nyc": "^13.0.1",
    "sass-loader": "^6.0.6",
    "style-loader": "^0.19.0",
    "supertest": "^3.3.0",
    "url-loader": "^0.6.2",
    "webpack-cli": "^2.0.14",
    "webpack-dev-server": "^2.9.4",
    "worker-loader": "^1.1.1"

webpack conf:
 module: {
    rules: [
      {
            test: /\.glsl$/i,
            include: /node_modules(\/|\\)vtk\.js(\/|\\)/,
            loader: 'shader-loader',
      },
      {
            test: /\.worker\.js$/,
            include: /node_modules(\/|\\)vtk\.js(\/|\\)/,
            use: [
                {
                    loader: 'worker-loader',
                    options: { inline: true, fallback: false },
                },
            ],
      },
      { 
        test: /\.(js|jsx)$/,
        exclude: /node_modules/,
        use:['babel-loader']
      },
      {
        test:/\.(s*)css$/,
        use:['style-loader','css-loader', 'sass-loader']
      },
      {
        test: /.(png|jpg|jpeg|gif|svg|woff|woff2|ttf|eot|ico)$/,
        loader: 'url-loader?limit=10000'
      }
    ].concat(vtkRules),

babelrc:
{
  "presets": [
    "es2015",
    "react"
  ]
}





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list