Git Product home page Git Product logo

webpack-globals-loader's People

Contributors

bensampaio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sudeep-sinha

webpack-globals-loader's Issues

Order of required fies

Hello and thank you for creating this!
So I am having an issue with the order in which these files are included.

Here is how I add various THREE.js files

require("globals!../third_party/three.js");
require('globals!../third_party/Detector.js');

require('globals!../third_party/shaders/CopyShader.js');
require('globals!../third_party/shaders/ParticlesShader.js');
require('globals!../third_party/shaders/DigitalGlitch.js');
require('globals!../third_party/shaders/HorizontalBlurShader.js');
require('globals!../third_party/shaders/VerticalBlurShader.js');

require('globals!../third_party/postprocessing/EffectComposer.js');
require('globals!../third_party/postprocessing/RenderPass.js');
require('globals!../third_party/postprocessing/MaskPass.js');
require('globals!../third_party/postprocessing/ShaderPass.js');
require('globals!../third_party/postprocessing/GlitchPass.js');
require('globals!../third_party/postprocessing/FilmPass.js');

And in the generated vendor.js I see that THREE.CopyShader is included before the main Three file.

Here is my webpack config:

var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');

module.exports = {

  entry: {
    app: path.resolve(__dirname, '../src/client/page.js'),
  },

  output: {
    path: path.resolve(__dirname, '../dist'),
    filename: 'bundle.js'
  },
  resolve: {
      alias: {
        'THREE': path.resolve(__dirname + '../src/client/third_party/three.js'),
        'Detector': path.resolve(__dirname + '../src/client/third_party/Detector.js')
      }
  },
  module: {
    loaders: [
      {
        test: /src\/.+.js$/,
        exclude: /node_modules/,
        loader: 'babel'
      },
      {
        test: /\.scss$/,
        loader: ExtractTextPlugin.extract('css!sass')
      }
    ]
  },

  sassLoader: {
    includePaths: [path.resolve(__dirname, '../src/client/sass')]
  },

  plugins: [
    new ExtractTextPlugin('style.css', {
        allChunks: true
    }),
    new webpack.optimize.UglifyJsPlugin({
      minimize: false
    })
  ]
};

Any ideas on enforcing order? Apologies, I am a bit new to all this front end stuff. Willing to make a PR if you can point me in the right direction

permission error when using webpack-dev-server

First of all thanks for making this, it is exactly what I've been looking for. I'm running into a permission error when using this loader with webpack-dev-server.

ERROR in ./~/globals-loader!./src/models/todo.js
Module build failed: Error: EACCES, permission denied '//vendor.js'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.writeFileSync (fs.js:1099:15)
    at Object.module.exports (/path/to/project/node_modules/globals-loader/index.js:23:6)
 @ ./src/main.js 4:0-32

The require I have is:

require('globals!./models/foo')

I'm looking into this at the moment, but I thought I'd throw this up here first since I've not done a ton of work with Webpack, especially with building loaders.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.