bensampaio / webpack-globals-loader Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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
Hello, I have received following error then compile webpack
Module '/var/www/laravel/robo.cash/node_modules/globals/index.js' is not a loader (must have normal or pitch function)
I trying to use outdated-browser package as globals
require("globals!outdated-browser/outdatedbrowser/outdatedbrowser");
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.